@lgd-utils/object
TypeScript icon, indicating that this package has built-in type declarations

0.0.14 • Public • Published

@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

Related

Package Sidebar

Install

npm i @lgd-utils/object

Weekly Downloads

1

Version

0.0.14

License

MIT

Unpacked Size

348 kB

Total Files

11

Last publish

Collaborators

  • lgd.huafeeng