sanitize-object

0.1.0 • Public • Published

💊 sanitize-object

NPM Version node Build Status

Experimental JS Object cleanup

Installation

$ npm install sanitize-object

Example

const { exclude, only } = require('sanitize-object/exclude')
 
const sanitizeUser = exclude('password', 'id')
const result = sanitizeUser({id: 42, name: 'Rupert', password: 'qwerty'})
// result: { name: 'Rupert'}
 
const sanitizeUser = only('name')
const result = sanitizeUser({id: 42, name: 'Rupert', password: 'qwerty'})
// result: { name: 'Rupert'}
 

Readme

Keywords

none

Package Sidebar

Install

npm i sanitize-object

Weekly Downloads

143

Version

0.1.0

License

MIT

Last publish

Collaborators

  • dotcypress