Documentation ¶
Index ¶
- func Has(_ context.Context, args ...core.Value) (core.Value, error)
- func KeepKeys(_ context.Context, args ...core.Value) (core.Value, error)
- func Keys(_ context.Context, args ...core.Value) (core.Value, error)
- func Merge(_ context.Context, args ...core.Value) (core.Value, error)
- func MergeRecursive(_ context.Context, args ...core.Value) (core.Value, error)
- func NewLib() map[string]core.Function
- func Values(_ context.Context, args ...core.Value) (core.Value, error)
- func Zip(_ context.Context, args ...core.Value) (core.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Has ¶
Has returns the value stored by the given key. @params (String) - The key name string. @returns (Boolean) - True if the key exists else false.
func KeepKeys ¶ added in v0.7.0
KeepKeys returns a new object with only given keys. @params src (Object) - source object. @params keys (Array Of String OR Strings) - keys that need to be keeped. @returns (Object) - New Object with only given keys.
func Keys ¶
Keys returns string array of object's keys @params obj (Object) - The object whose keys you want to extract @params sort (Boolean, optional) - If sort is true, then the returned keys will be sorted. @returns (Array of String) - Array that contains object keys.
func Merge ¶
Merge merge the given objects into a single object. @params objs (Array Of Object OR Objects) - objects to merge. @returns (Object) - Object created by merging.
func MergeRecursive ¶ added in v0.4.0
MergeRecursive recursively merge the given objects into a single object. @params objs (Objects) - objects to merge. @returns (Object) - Object created by merging.
func Values ¶ added in v0.4.0
Values return the attribute values of the object as an array. @params obj (Object) - an object. @returns (Array of Value) - the values of document returned in any order.
func Zip ¶
Zip returns an object assembled from the separate parameters keys and values. Keys and values must be arrays and have the same length. @params keys (Array of Strings) - an array of strings, to be used as key names in the result. @params values (Array of Objects) - an array of core.Value, to be used as key values. @returns (Object) - an object with the keys and values assembled.
Types ¶
This section is empty.