1.0.0 • Published 8 years ago

@f/changed-keys v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 years ago

changed-keys

Build status Git tag NPM version Code style

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 value
  • prev - The old value

Returns: An array containing the unique list of keys that are different between the two.

License

MIT