1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-11-23 21:54:45 +02:00

Added object 'KEEP' function (#88)

* add unit tests for KEEP function

* added KEEP function

* added doc for KEYS function

* addded isEqualObjects function to objects tests
This commit is contained in:
3timeslazy
2018-10-09 23:13:00 +03:00
committed by Tim Voronov
parent ab63371892
commit 0bc4280d3f
4 changed files with 257 additions and 0 deletions

View File

@@ -8,6 +8,12 @@ import (
"github.com/MontFerret/ferret/pkg/runtime/values"
)
/*
* 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 Keys(_ context.Context, args ...core.Value) (core.Value, error) {
err := core.ValidateArgs(args, 1, 2)
if err != nil {