remove-undefined-objects
TypeScript icon, indicating that this package has built-in type declarations

5.0.0 • Public • Published

remove-undefined-objects

Build

Installation

npm install --save remove-undefined-objects

Usage

import removeUndefinedObjects from 'remove-undefined-objects';

console.log(removeUndefinedObjects({key: [], key2: 123}));
// { key2: 123 }

Behavior

Any items with the following value will be removed:

  • Empty object, {}
  • Empty array, []
  • Undefined, undefined

The following items will NOT be removed:

  • Empty string, ''
  • Null, null

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i remove-undefined-objects

    Weekly Downloads

    170,005

    Version

    5.0.0

    License

    MIT

    Unpacked Size

    16.9 kB

    Total Files

    12

    Last publish

    Collaborators

    • gratcliff
    • dannobytes
    • gkoberger
    • domharrington
    • mjcuva
    • kanadgupta
    • jonursenbach
    • rafegoldberg
    • dashron
    • iliast