fix: add std.objectKeysValues to jsonnet-lint (#706)

This commit is contained in:
zephyros-dev 2023-06-27 02:40:39 +07:00 committed by GitHub
parent 7b9f5fd4b4
commit fed90cd9cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 12 deletions

View File

@ -31,9 +31,11 @@ func prepareStdlib(g *typeGraph) {
"objectHas": g.newSimpleFuncType(boolType, "o", "f"),
"objectFields": g.newSimpleFuncType(arrayOfString, "o"),
"objectValues": g.newSimpleFuncType(anyArrayType, "o"),
"objectKeysValues": g.newSimpleFuncType(anyArrayType, "o"),
"objectHasAll": g.newSimpleFuncType(boolType, "o", "f"),
"objectFieldsAll": g.newSimpleFuncType(arrayOfString, "o"),
"objectValuesAll": g.newSimpleFuncType(anyArrayType, "o"),
"objectKeysValuesAll": g.newSimpleFuncType(anyArrayType, "o"),
"prune": g.newSimpleFuncType(anyObjectType, "a"),
"mapWithKey": g.newSimpleFuncType(anyObjectType, "func", "obj"),
"get": g.newFuncType(anyType, []ast.Parameter{required("o"), required("f"), optional("default"), optional("inc_hidden")}),

View File

@ -140,6 +140,8 @@
"objectFieldsAll": [ ],
"objectHas": false,
"objectHasAll": false,
"objectKeysValues": [ ],
"objectKeysValuesAll": [ ],
"objectValues": [ ],
"objectValuesAll": [ ],
"parseHex": 3735928559,

View File

@ -16,9 +16,11 @@
objectHas: std.objectHas(o={}, f="fieldname"),
objectFields: std.objectFields(o={}),
objectValues: std.objectValues(o={}),
objectKeysValues: std.objectKeysValues(o={}),
objectHasAll: std.objectHasAll(o={}, f="fieldname"),
objectFieldsAll: std.objectFieldsAll(o={}),
objectValuesAll: std.objectValuesAll(o={}),
objectKeysValuesAll: std.objectKeysValuesAll(o={}),
prune: std.prune(a={x: null, y: [null, "42"]}),
mapWithKey: std.mapWithKey(func=function(key, value) 42, obj={a: 17}),
get: [