cleanzr
v1.0.2
Published
Removes null, undefined, empty strings, or NaN values from an object recursively.
Maintainers
Readme
🧼 Cleanzr
Removes null, undefined, empty strings, or NaN values from objects recursively.
Perfect for cleaning API payloads or form data before submission.
🚀 Installation
npm install cleanzror with Yarn:
yarn add cleanzr🧩 Usage
import { cleanzr } from "cleanzr";
const data = {
name: "",
age: null,
address: { city: "New York", zip: undefined },
score: NaN,
};
const cleaned = cleanzr(data);
// => { address: { city: "New York" } }⚙️ Features
- Recursively removes unwanted values.
- Works with arrays and nested objects.
- TypeScript and JavaScript compatible.
🪪 License
MIT © 2025 Vinod Selvin
