2.3.0 • Published 3 years ago

just-compare v2.3.0

Weekly downloads
7,352
License
MIT
Repository
github
Last release
3 years ago

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

npm install just-compare
yarn add just-compare

Compare two collections

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
brael-solarenginesabp-zero-templates-gabp-zero-template-gmanualabp-zero-templat-gabp-zero-template-gcointervu@tequ/xrplfusion-plugin-react-router@everything-registry/sub-chunk-1995svelte-zooming-uisvelte-zoomming-uisvelte-zomming-uisvelte-maplibresvelte-maplibre-link2023waldojsstorybook-addon-recoil-flowsportotekavalmirijs-awejylibkahit-anoimdone-vue-liblookemanual-publish-lancelance-kpi-box@thejohnfreeman/react-forms@thirtymadison/quiz-ui@xwink/dao@zalastax/nolb-jus@zilue/ng.coreabp-antech-jpacsabp-zero-templates-localabp-zero-templates-mcabp-zero-templates-ralphabp-zero-templates-redabp-zero-templatexabp-zerojpacs360abp-zerojpacs361abpjpacs348abp-jpacs394abp-jpacs395abp-jpacs478abp-jpacs520abp-zero-template-qweralabp-zero-template-qwertyabp-zero-template-ralph1abp-zero-template-ralph3abp-zero-template-ralphrabp-zero-template-ralphraabp-zero-template-raraabp-zero-template-redabp-zero-template-redsabp-zero-template-reeseabp-zero-template-reesesabp-zero-template-reesesesabp-zero-template-resaabp-zero-template-resaaabp-zero-template-resaaaabp-zero-template-resaaaaabp-zero-template-rr2abp-zero-template-rr3abp-zero-template-rr4abp-zero-template-rr6abp-zero-template-rr7abp-zero-template-rr8abp-zero-template-rralpabp-zero-template-rsabp-zero-template-rstabp-zero-template-rweaabp-zero-template-test-cardingabp-zero-template-test-christianabp-zero-template-test-mcabp-zero-template-test3abp-zero-template-test4abp-zero-carabp-zero-cardsabp-zero-jpacs04abp-zero-jpacs10abp-zero-jpacs11abp-zero-jpacs2abp-zero-laoxieabp-zero-manualabp-zero-manual-publishabp-zero-sprinthubtestingabp-zero-sprinthubtesting2abp-zero-templat-cardsabp-zero-template-aabp-zero-template-ababp-zero-template-abcabp-zero-template-asdabp-zero-template-babp-zero-template-bcabp-zero-template-bcdabp-zero-template-bnmabp-zero-template-cabp-zero-template-cardingabp-zero-template-ccmcabp-zero-template-chayabp-zero-template-ghiabp-zero-template-cards
2.3.0

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.1

3 years ago

2.2.2

3 years ago

2.0.3

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

5 years ago

1.3.0

7 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.21

9 years ago

1.1.20

9 years ago

1.1.19

9 years ago

1.1.18

9 years ago

1.1.17

9 years ago

1.1.16

9 years ago

1.1.15

9 years ago

1.1.10

9 years ago

1.1.9

9 years ago

1.1.8

9 years ago

1.1.7

9 years ago

1.1.5

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago