pick
pick
function picks the specified keys from a JSON object.
Arguments
-
object
type:
object
The JSON object to pick keys from.
-
keys
type:
string[]
The keys to pick.
-
option
type:
object
-
arrayIndex
type:
"dot" | "bracket"
default:
"bracket"
The index of array to pick.
e.g.
[ "a[0]" ]
will pick to{ a: ["b"] }
ifarrayIndex
is"bracket"
, and[ "a.0" ]
will pick to{ a: { 0: "b" } }
ifarrayIndex
is"dot"
.
-