@f/changed-keys

1.0.0 • Public • Published

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

/@f/changed-keys/

    Package Sidebar

    Install

    npm i @f/changed-keys

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • f