Currently, $omitKeys(object, keys[]) works only when the input is a single object. However, in many real-world use cases, data is often represented as an array of objects, requiring users to manually map over the array to apply $omitKeys to each item.
Problem
Given an input like:
[
{ "a": 1, "b": 2 },
{ "a": 3, "b": 4 }
]
Users currently need to write::
$map(data, function($v) { $omitKeys($v, ["b"]) })
or
Proposed Enhancement
Allow $omitKeys to accept an array of objects as input and apply the omission to each element automatically.
Example:
####Expected Output:
[
{ "a": 1 },
{ "a": 3 }
]
Currently,
$omitKeys(object, keys[])works only when the input is a single object. However, in many real-world use cases, data is often represented as an array of objects, requiring users to manually map over the array to apply $omitKeys to each item.Problem
Given an input like:
[ { "a": 1, "b": 2 }, { "a": 3, "b": 4 } ]Users currently need to write::
or
Proposed Enhancement
Allow
$omitKeysto accept an array of objects as input and apply the omission to each element automatically.Example:
####Expected Output:
[ { "a": 1 }, { "a": 3 } ]