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

Readme

Keywords

none

Package Sidebar

Install

npm i remove-undefined-objects

Weekly Downloads

187,718

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