Can assign-update style

This commit is contained in:
Mike Farah
2021-02-11 10:58:40 +11:00
parent 8c1f7dfbd7
commit 5a1b81cbfc
4 changed files with 76 additions and 29 deletions
+9 -1
View File
@@ -86,7 +86,7 @@ e: >-
},
},
{
description: "Pretty print",
description: "Reset style - or pretty print",
subdescription: "Set empty (default) quote style, note the usage of `...` to match keys too. Note that there is a `--prettyPrint/-P` short flag for this.",
document: `{a: cat, "b": 5, 'c': 3.2, "e": true}`,
expression: `... style=""`,
@@ -94,6 +94,14 @@ e: >-
"D0, P[], (!!map)::a: cat\nb: 5\nc: 3.2\ne: true\n",
},
},
{
description: "Set style relatively with assign-update",
document: `{a: single, b: double}`,
expression: `.[] style |= .`,
expected: []string{
"D0, P[], (doc)::{a: 'single', b: \"double\"}\n",
},
},
{
skipDoc: true,
document: `{a: cat, b: double}`,