@taktikorg/dolor-tempora v3.9.85
@taktikorg/dolor-tempora
Removes empty objects, arrays, empty strings, NaN, null and undefined values from objects. Does not alter the original object.
As of version 3.0.0, @taktikorg/dolor-tempora traverses arrays as well as objects.
Status
Installation
Install the package via npm
:
$ npm install @taktikorg/dolor-tempora --save
Usage
Arguments
object
(Object): The source object.[options]
(Object): An optional object with the following options:
Option | Default value | Description |
---|---|---|
cleanKeys | [] | Remove specific keys, ie: ['foo', 'bar', ' '] |
cleanValues | [] | Remove specific values, ie: ['foo', 'bar', ' '] |
emptyArrays | true | Remove empty arrays, ie: [] |
emptyObjects | true | Remove empty objects, ie: {} |
emptyStrings | true | Remove empty strings, ie: '' |
NaNValues | false | Remove NaN values, ie: NaN |
nullValues | true | Remove null values, ie: null |
undefinedValues | true | Remove undefined values, ie: undefined |
(Object): Returns the cleansed object.
Example
const cleanDeep = require('@taktikorg/dolor-tempora');
const object = {
bar: {},
baz: null,
biz: 'baz',
foo: '',
net: [],
nit: undefined,
qux: {
baz: 'boz',
txi: ''
}
};
cleanDeep(object);
// => { biz: 'baz', qux: { baz: 'boz' } }
Tests
$ npm test
Release
npm version [<newversion> | major | minor | patch] -m "Release %s"
License
MIT
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago