Returns a new object with desired content from another source
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.npmignore
README.md
index.js
package.json
test.js

README.md

sanitize-object

Returns a new object with desired content from another source

Install

$ npm install sanitize-object

Usage

sanitize = require('sanitize-object')

input = {
  foo: 123,
  bar: 456,
  qux: 789
}

sanitize('foo', 'qux')(input)
// => { foo: 123, qux: 789 }