-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config should return undefined when object has no keys #41
Comments
I think the configs
.map(config => {
if (!config) return { labels: [] }
return { labels: config.labels ? config.labels : config };
}) I don't think that would be much better? Or am I missing something? |
You can see my use over here btw: crazy-max/ghaction-github-labeler#125 |
Perhaps the config entry should not be added if the object has no keys and simply provide an empty array of configs or if extends is used the parent config is the only entry. |
I think this: octokit-plugin-config/src/util/get-config-files.ts Lines 66 to 67 in 3975be2
Could be written as delete requestedRepoFile.config._extends;
const files = [];
if (Object.keys(requestedRepoFile).length !== 0) {
files.push(requestedRepoFile)
} |
It makes more sense, this is a custom merge strategy using the |
No worries. |
Inside a custom default the config object can be
{}
when_extends
is used.To workaround it, you need to write something like this:
if you returned
undefined
after deleting the_extends
key that would make it easier to merge objects.The text was updated successfully, but these errors were encountered: