mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-07 02:48:27 +08:00
Adding splat[] short hand to collect,eval,map,omit,path,pick
This commit is contained in:
@@ -14,6 +14,15 @@ var evalOperatorScenarios = []expressionScenario{
|
||||
"D0, P[a b 1], (!!map)::{name: cat}\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "eval splat",
|
||||
skipDoc: true,
|
||||
document: `{pathExp: '.a.b[] | select(.name == "cat")', a: {b: [{name: dog}, {name: cat}]}}`,
|
||||
expression: `eval(.pathExp)[]`,
|
||||
expected: []string{
|
||||
"D0, P[a b 1 name], (!!str)::cat\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Dynamically update a path from an environment variable",
|
||||
subdescription: "The env variable can be any valid yq expression.",
|
||||
|
||||
Reference in New Issue
Block a user