-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
How to dump empty key value to yaml? #356
Comments
empty value === null in yaml. No way to define such dumping style. Other styles can be tweaked via options https://github.com/nodeca/js-yaml#safedump-object---options- |
Ok, |
There are no such thing as |
@puzrin isn't there a way just to ignore |
Right now - no. Dumper expects you to provide correct (dumpable) source. There is reasonable suggestion #339, but it's not implemented. |
Ok, currently I worked it around by using |
Hi, |
It is safer to remove matter.stringify(
content,
Object.entries(
programmaticallyGeneratedData,
).reduce((a, [k, v]) => (v === undefined ? a : { ...a, [k]: v }), {}),
) However, if you need to remove deep undefined, you might need https://github.com/patarapolw/deepfind#patarapolwdeepfind then |
js-yaml implements the YAML spec and it has no undefined type: - nodeca/js-yaml#356 (comment) I.e.: ``` > require('js-yaml').safeLoad('releases:\n') { releases: null } ```
js-yaml implements the YAML spec and it has no undefined type: - nodeca/js-yaml#356 (comment) I.e.: ``` > require('js-yaml').safeLoad('releases:\n') { releases: null } ```
js-yaml implements the YAML spec and it has no undefined type: - nodeca/js-yaml#356 (comment) I.e.: ``` > require('js-yaml').safeLoad('') undefined > require('js-yaml').safeLoad('releases:\n') { releases: null } ```
…es (#1536) js-yaml implements the YAML spec and it has no undefined type: - nodeca/js-yaml#356 (comment) I.e.: ``` > require('js-yaml').safeLoad('') undefined > require('js-yaml').safeLoad('releases:\n') { releases: null } ```
Need to get from js:
not
not
?
The text was updated successfully, but these errors were encountered: