shiny-object

1.0.0 • Public • Published

Shiny Object

Make your objects shine by cleaning off all the dirt. (eg. undefined, empty objects)

Usage

const shiny = require('shiny-object');
 
// input is not mutated
shiny(
  {
    string: '',
    nill: null,
    undef: undefined,
    arr: [{ key: '' }],
    fn: () => ({ func: () => {} }),
    clean: 'value',
  },
  {
    // All options default to false
    noUndefined: true,
    noNull: true,
    noFunction: true,
    noEmptyString: true,
    noEmptyArray: true,
    noEmptyObject: true,
  }
); // { clean: 'value' }

Readme

Keywords

none

Package Sidebar

Install

npm i shiny-object

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

14.7 kB

Total Files

5

Last publish

Collaborators

  • moeriki