removeEmptyKeys
removeEmptyKeys(obj, shallow)
removeEmptyKeys(obj, shallow)Arguments
Returns
Example
typescript
import { removeEmptyKeys } from 'check-engineering/ts-utils';
const data = {
name: 'Alice',
age: null,
address: {
street: '123 Main St',
city: '',
zip: undefined
}
};
const cleanedData = removeEmptyKeys(data); // => { name: 'Alice', address: { street: '123 Main St' } }Usage
Notes
Last updated