Utils for insert elements in array/object.
Array
[
...,
...insertIf(condition, element),
...,
]
Object
{
...,
...insertIf(condition, {key: value}),
...,
}
Conditionally add elements to object/array
Homepage Repository npm TypeScript Download
npm install insert-into-if@1.0.1
Utils for insert elements in array/object.
[
...,
...insertIf(condition, element),
...,
]
{
...,
...insertIf(condition, {key: value}),
...,
}