Improving docs

This commit is contained in:
Mike Farah
2021-02-26 11:31:43 +11:00
parent b1a5387cdd
commit e93c43f7a0
7 changed files with 55 additions and 8 deletions
+9
View File
@@ -28,6 +28,15 @@ var hasOperatorScenarios = []expressionScenario{
"D0, P[3], (!!bool)::false\n",
},
},
{
description: "Select, checking for existence of deep paths",
subdescription: "Simply pipe in parent expressions into `has`",
document: "- {a: {b: {c: cat}}}\n- {a: {b: {d: dog}}}",
expression: `.[] | select(.a.b | has("c"))`,
expected: []string{
"D0, P[0], (!!map)::{a: {b: {c: cat}}}\n",
},
},
{
dontFormatInputForDoc: true,
description: "Has array index",