-
Notifications
You must be signed in to change notification settings - Fork 97
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
Clarification on the defaults argument needed #76
Comments
this is a news to me actually! It should be an object, maybe it snuck in via some pull request. Though, the thing past @dominictarr wasn't taking into account is that quite likely putting a string in that position was an accident, and so this makes it passively pass but not do what you expected. |
OK that explains a lot ;) |
I improved the type check and wrote some tests for variable types that could cause problems. |
I actually think that the passing a file path for default args is a good idea and should be documented. |
From the documentation I would assume that the second argument for rc should always be an object.
Reviewing the code I noticed that there is also a handling for the default param being a string. I would assume that this was meant to be an option to pass a stringified JSON object as the defaults variable is handed to utils.json() then.
Looking through utils.json() the defaults var (which has to be a string at this point) is passed to utils.file(). This leads me to the conclusion that the second argument could also be a path to a .json or .ini file?
If that is right, I think it would be a good idea if this was documented.
The text was updated successfully, but these errors were encountered: