@lgd-utils/object
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
- @lgd-utils/array - A front-end array tool
- @lgd-utils/axios - A axios adapter and middleware tool
- @lgd-utils/cached-storage - 一个具有失效功能的缓存存储库
- @lgd-utils/collection - A front-end collection tool
- @lgd-utils/error - A front-end error tool
- @lgd-utils/html - A front-end html tool
- @lgd-utils/number - A front-end number tool
- @lgd-utils/regexp - A front-end regexp tool
- @lgd-utils/symbol - A front-end symbol tool
- @lgd-utils/utils - A front-end utils tool
- @lgd-utils/validate - A front-end verification tool
- More…