Function: filterEmptyPropObj

filterEmptyPropObj(obj): Record<string, any> | undefined

过滤对象中为空的属性

Parameters

Name Type Description
obj Record<string, any> 需要过滤的对象

Returns

Record<string, any> | undefined

过滤后的对象,如果输入不是对象则返回undefined

Example

filterEmptyPropObj({name: 'foo', sex: ''});
// => {name: 'foo'}
ON THIS PAGE