Function
Static Public Summary | ||
public |
getDefined(target: Object, options: Object): Object Takes an object and returns a new object that contains only the "defined" values. |
Static Public
public getDefined(target: Object, options: Object): Object source
import getDefined from '@loopmode/defined/src/getDefined.js'
Takes an object and returns a new object that contains only the "defined" values.
Values are dropped if they either are included in the drop
array, or they are an empty object and the keepObjects
flag is not set.
Params:
Name | Type | Attribute | Description |
target | Object | An object with properties that shall be omitted if empty |
|
options | Object |
|
Optional settings |
options.drop | Array |
|
Values that should be treated as "non-defined" values |
options.keepObjects | Boolean |
|
Whether to keep values that are an empty object |