cue export foldany.cue | |
cmp stdout expect-stdout-cue | |
-- frontmatter.toml -- | |
title = "Folding all Fields" | |
description = "" | |
-- text.md -- | |
This also works if a struct has more than one member. | |
In general, any JSON object can be expressed as a collection of | |
path-leaf pairs without using any curly braces. | |
-- foldany.cue -- | |
outer middle1 inner: 3 | |
outer middle2 inner: 7 | |
-- expect-stdout-cue -- | |
{ | |
"outer": { | |
"middle1": { | |
"inner": 3 | |
}, | |
"middle2": { | |
"inner": 7 | |
} | |
} | |
} |