Closed meyverick closed 2 years ago
@meyverick Sorry for replying late. TOML.stringify
returns an array of strings, if there is no options.newline
, because the lib doesn't know use what to join lines.
See the docs:
When you pass it into TOML.parse
, it throws, because TOML.parse
only accept string | Buffer | { path, data }
currently.
I may (or may not) add this feature (parsing array of lines) in the future.
To help users to notice that TOML.stringify
WON'T return string while there is no option newline
, currently I don't add the feature that supporting parsing array of lines, and I make it more friendly to notice that since v1.33.0.
When users widely know the options.newline
, I will add the feature of parsing array; or I found users will never remember that, then I may remove the feature that TOML.stringify
returning array.
I try to
stringify
the readme example and thenparse
it and it returns an error. Am I doing it wrong?Script
Returns