Skip to content

goto-bus-stop/object-delete-value

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

object-delete-value

delete keys with the given value from an object

npm travis standard

Install

npm install object-delete-value

Usage

var deleteValue = require('object-delete-value')

var obj = {
  abc: 'def',
  ghi: 'whaddup',
  jkl: 'alphabets',
  xyz: 'whaddup'
}

deleteValue(obj, 'whaddup')
// → { abc: 'def',
//     jkl: 'alphabets' }

API

deleteValue(obj, value)

Delete all keys from obj whose values strict-equal value. Return obj.

License

Apache-2.0