@f/changed-keys
v1.0.0
Published
Returns the list of keys that changed between two values
Downloads
5
Readme
changed-keys
Returns the list of keys that changed between two values
Installation
$ npm install @f/changed-keys
Usage
var changedKeys = require('@f/changed-keys')
changedKeys({a: 1}, {a: 1, b: 2}) // -> ['b']
changedKeys([0, 1, 2], [0, 2, 3]) // -> [1, 2]
API
changedKeys(next, prev)
next
- The new valueprev
- The old value
Returns: An array containing the unique list of keys that are different between the two.
License
MIT