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
always use lodash.get #74
Conversation
Are there any reasons that someone wouldn't want the nested option always enabled? Since this would require a major version bump. |
@knownasilya I don't think so. The PR ignores the nested options entriely. I don't think someone specified "nested" field strings by accident. |
I meant more like if they didn't use nested before, and now it's using nested by default (because of this PR), would it break anything? |
no, this wouldn't break anything. |
The only thing that would break is they would see an error when using the nested option. Looks like it'll have to be a major bump. |
good spot! |
i was thinking of adding custom defaults to single fields like this json2csv({ data: myCars,
fields: ['car', 'prize', 'color'],
defaultValue: ['No Name', 0, 'likely black']}, ... what do you think? |
Great idea, it would fulfill #71 |
call it |
ok |
* `nested` has been removed as an option. All fields support nesting by default. See #74. * `fields` has been overhauled to accept an object (see #78) with the following form: - `label` - optional, defaults to the value of `value` - `value` - required, Can be a string, or a function that receives the row as a param, see the README. - `default` - optional, overrides the `defaultValue` option. It can also just be a string, which is the `value`.
makes nested option absolete