1.0.0 • Published 6 years ago

shiny-object v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

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' }
1.0.0

6 years ago

0.9.0

8 years ago