Skip to content

Variables

compactObject

const compactObject: CompactObject

移除对象值为 nullundefined 的属性

Param

目标对象

Example

ts
compactObject({ a: 0, b: undefined, c: null, d: '', f: false, e: NaN })
// => { a: 0, d: '', f: false, e: NaN }