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