mirror of
https://github.com/google/go-jsonnet.git
synced 2025-08-08 07:17:12 +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._placeholders[anyObjectType] = concreteTP(TypeDesc{
|
||||
ObjectDesc: anyObjectDesc,
|
||||
|
@ -14,6 +14,7 @@ const (
|
||||
nullType
|
||||
anyArrayType
|
||||
numberArrayType
|
||||
boolArrayType
|
||||
anyObjectType
|
||||
anyFunctionType
|
||||
stdlibType
|
||||
|
@ -144,6 +144,9 @@ func prepareStdlib(g *typeGraph) {
|
||||
"minArray": 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"),
|
||||
// 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"),
|
||||
"removeAt": g.newSimpleFuncType(anyArrayType, "arr", "i"),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user