just-flush
TypeScript icon, indicating that this package has built-in type declarations

2.3.0 • Public • Published

just-flush

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-flush
yarn add just-flush

Returns a copy of an array or object with null/undefined members removed

import flush from 'just-flush';

flush([1, undefined, 2, null, 3, NaN, 0]); // [1, 2, 3, NaN, 0]
flush([true, null, false, true, [null], undefined]); // [true, false, true, [null]]
flush({a: 2, b: null, c: 4, d: undefined}); // {a: 2, c: 4}
flush('something'); // undefined
flush(); // undefined

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i just-flush

      Weekly Downloads

      5,454

      Version

      2.3.0

      License

      MIT

      Unpacked Size

      7.18 kB

      Total Files

      9

      Last publish

      Collaborators

      • angus-c