npm.io
0.0.14 • Published 4 years ago

@lgd-utils/object

Licence
MIT
Version
0.0.14
Deps
2
Size
340 kB
Vulns
0
Weekly
0
Stars
16

@lgd-utils/object

Bundle size MIT NPM downloads NPM version lodash npm styled with prettier

A front-end object tool

Usage

import object from '@lgd-utils/object';

const { omitNil, omitUndefined, sortObjectByProp } = object;
console.log(omitNil({ key: 'value', key1: null, key2: void 0 })); // { key: 'value' }
console.log(omitUndefined({ key: 'value', key1: null, key2: void 0 })); // { key: 'value', key1: null }
console.log(JSON.stringify(sortObjectByProp({ b: 2, a: '1', d: true, c: [33, 3], g: null, f: { ff: 55, ee: 4 } }))); // '{"a":"1","b":2,"c":[33,3],"d":true,"f":{"ee":4,"ff":55},"g":null}'

Contribute

Documentation

Keywords