just-compare
compare two collections
Last updated 2 years ago by angus-c .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install just-compare 
SYNC missed versions from official npm registry.

just-compare

Part of a library of zero-dependency npm modules that do just do one thing.
Guilt-free utilities for every occasion.

Try it now

import compare from 'just-compare';

// primitives: value1 === value2
// functions: value1.toString == value2.toString
// arrays: if length, sequence and values of properties are identical
// objects: if length, names and values of properties are identical
compare([1, [2, 3]], [1, [2, 3]]); // true
compare([1, [2, 3], 4], [1, [2, 3]]); // false
compare({a: 2, b: 3}, {a: 2, b: 3}); // true
compare({a: 2, b: 3}, {b: 3, a: 2}); // true
compare({a: 2, b: 3, c: 4}, {a: 2, b: 3}); // false
compare({a: 2, b: 3}, {a: 2, b: 3, c: 4}); // false
compare([1, [2, {a: 4}], 4], [1, [2, {a: 4}]]); // false
compare([1, [2, {a: 4}], 4], [1, [2, {a: 4}], 4]); // true
compare(NaN, NaN); // true

Current Tags

  • 1.3.0                                ...           latest (2 years ago)

19 Versions

  • 1.3.0                                ...           2 years ago
  • 1.2.2                                ...           3 years ago
  • 1.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.21                                ...           4 years ago
  • 1.1.20                                ...           4 years ago
  • 1.1.19                                ...           4 years ago
  • 1.1.18                                ...           4 years ago
  • 1.1.17                                ...           4 years ago
  • 1.1.16                                ...           4 years ago
  • 1.1.15                                ...           4 years ago
  • 1.1.10                                ...           4 years ago
  • 1.1.9                                ...           4 years ago
  • 1.1.8                                ...           4 years ago
  • 1.1.7                                ...           4 years ago
  • 1.1.5                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 3
This Week 175
This Month 3
Last Day 45
Last Week 378
Last Month 1,783
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (237)

Copyright 2014 - 2016 © taobao.org |