mirror of
https://github.com/google/go-jsonnet.git
synced 2025-08-08 15:27:13 +02:00
Adds std.any and std.all to jsonnet-lint (#695)
Co-authored-by: Dave Cunningham <sparkprime@gmail.com>
This commit is contained in:
parent
7edd5d373b
commit
44538a33e1
@ -139,6 +139,13 @@ func newTypeGraph(importFunc ImportFunc) *typeGraph {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
g.newPlaceholder()
|
||||||
|
g._placeholders[boolArrayType] = concreteTP(TypeDesc{
|
||||||
|
ArrayDesc: &arrayDesc{
|
||||||
|
furtherContain: []placeholderID{boolType},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
g.newPlaceholder()
|
g.newPlaceholder()
|
||||||
g._placeholders[anyObjectType] = concreteTP(TypeDesc{
|
g._placeholders[anyObjectType] = concreteTP(TypeDesc{
|
||||||
ObjectDesc: anyObjectDesc,
|
ObjectDesc: anyObjectDesc,
|
||||||
|
@ -14,6 +14,7 @@ const (
|
|||||||
nullType
|
nullType
|
||||||
anyArrayType
|
anyArrayType
|
||||||
numberArrayType
|
numberArrayType
|
||||||
|
boolArrayType
|
||||||
anyObjectType
|
anyObjectType
|
||||||
anyFunctionType
|
anyFunctionType
|
||||||
stdlibType
|
stdlibType
|
||||||
|
@ -144,6 +144,9 @@ func prepareStdlib(g *typeGraph) {
|
|||||||
"minArray": g.newFuncType(anyArrayType, []ast.Parameter{required("arr"), optional("keyF")}),
|
"minArray": g.newFuncType(anyArrayType, []ast.Parameter{required("arr"), optional("keyF")}),
|
||||||
"maxArray": g.newFuncType(anyArrayType, []ast.Parameter{required("arr"), optional("keyF")}),
|
"maxArray": g.newFuncType(anyArrayType, []ast.Parameter{required("arr"), optional("keyF")}),
|
||||||
"contains": g.newSimpleFuncType(boolType, "arr", "elem"),
|
"contains": g.newSimpleFuncType(boolType, "arr", "elem"),
|
||||||
|
// TODO these need test cases written by someone who understands how to make them
|
||||||
|
"all": g.newSimpleFuncType(boolArrayType, "arr"),
|
||||||
|
"any": g.newSimpleFuncType(boolArrayType, "arr"),
|
||||||
"remove": g.newSimpleFuncType(anyArrayType, "arr", "elem"),
|
"remove": g.newSimpleFuncType(anyArrayType, "arr", "elem"),
|
||||||
"removeAt": g.newSimpleFuncType(anyArrayType, "arr", "i"),
|
"removeAt": g.newSimpleFuncType(anyArrayType, "arr", "i"),
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user