moleike / haskell-jsonnet

🎏 Haskell implementation of Jsonnet
https://hackage.haskell.org/package/jsonnet
Other
21 stars 6 forks source link

Implement std.objectHas and std.objectHasAll #6

Closed moleike closed 4 years ago

moleike commented 4 years ago

This issue depends on #5.

It is possible to check field’s visibility using std.objectHas and std.objectHasAll standard library functions.

Ref: https://jsonnet.org/ref/stdlib.html

std.objectHas(o, f): Returns true if the given object has the field (given as a string), otherwise false. Raises an error if the arguments are not object and string respectively. Returns false if the field is hidden.

std.objectHasAll(o, f): As std.objectHas but also includes hidden fields.

moleike commented 4 years ago

added in dd7024cd86e4e9073b4395c9e01d5de917e6d67b