UNPKG

clean-object-keys

Version:

A tiny JavaScript utility to remove null, undefined, and empty string values from objects. Lightweight and supports nested objects.

13 lines (10 loc) 262 B
const { cleanObject } = require('../src/index'); const dirtyObject = { name: 'Manu', age: null, address: '', phone: undefined, city: 'Delhi', }; const cleaned = cleanObject(dirtyObject); console.log('Cleaned Object:', cleaned);