generated from tpl/purs
fix: omit nulls
This commit is contained in:
parent
00fb682314
commit
dd513b1aac
@ -13,6 +13,15 @@ export function objToHash(valueToYAMLImpl, fst, snd, obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function toYAMLImpl(a) {
|
export function toYAMLImpl(a) {
|
||||||
// noCompatMode does not support YAML 1.1
|
const replacer = (_, v) => {
|
||||||
return yaml.dump(a, { noCompatMode: true })
|
if (typeof v === 'object') {
|
||||||
|
Object.keys(v).forEach(k => {
|
||||||
|
if (v[k] === null) {
|
||||||
|
delete v[k]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return yaml.dump(a, { noCompatMode: true, replacer })
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user