Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moeriki/shiny-object
https://github.com/moeriki/shiny-object
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/moeriki/shiny-object
- Owner: moeriki
- License: mit
- Created: 2015-12-17T12:50:24.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-10-01T16:44:04.000Z (over 6 years ago)
- Last Synced: 2024-12-21T23:36:13.000Z (about 1 month ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Shiny Object
Make your objects shine by cleaning off all the dirt. (eg. undefined, empty objects)
## Usage
```javascript
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' }
```