{"id":13608298,"url":"https://github.com/lukeed/dequal","last_synced_at":"2025-05-11T13:59:08.346Z","repository":{"id":34288700,"uuid":"174421655","full_name":"lukeed/dequal","owner":"lukeed","description":"A tiny (304B to 489B) utility to check for deep equality","archived":false,"fork":false,"pushed_at":"2024-11-06T21:59:58.000Z","size":34,"stargazers_count":1416,"open_issues_count":11,"forks_count":31,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-11T13:59:01.267Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukeed.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"lukeed"}},"created_at":"2019-03-07T21:17:50.000Z","updated_at":"2025-05-07T21:02:59.000Z","dependencies_parsed_at":"2024-11-05T21:01:18.275Z","dependency_job_id":"084a67cc-40f6-479b-b9a4-66e995fd8702","html_url":"https://github.com/lukeed/dequal","commit_stats":{"total_commits":58,"total_committers":5,"mean_commits":11.6,"dds":0.06896551724137934,"last_synced_commit":"37c21f675c1f538f2d4b63ebf19a161411e7a5fd"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fdequal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fdequal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fdequal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fdequal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukeed","download_url":"https://codeload.github.com/lukeed/dequal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253576262,"owners_count":21930169,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T19:01:26.176Z","updated_at":"2025-05-11T13:59:08.309Z","avatar_url":"https://github.com/lukeed.png","language":"JavaScript","readme":"# dequal [![CI](https://github.com/lukeed/dequal/workflows/CI/badge.svg)](https://github.com/lukeed/dequal/actions) [![licenses](https://licenses.dev/b/npm/dequal)](https://licenses.dev/npm/dequal)\n\n\u003e A tiny (304B to 489B) utility to check for deep equality\n\nThis module supports comparison of all types, including `Function`, `RegExp`, `Date`, `Set`, `Map`, `TypedArray`s, `DataView`, `null`, `undefined`, and `NaN` values. Complex values (eg, Objects, Arrays, Sets, Maps, etc) are traversed recursively.\n\n\u003e **Important:**\n\u003e * key order **within Objects** does not matter\n\u003e * value order **within Arrays** _does_ matter\n\u003e * values **within Sets and Maps** use value equality\n\u003e * keys **within Maps** use value equality\n\n\n## Install\n\n```\n$ npm install --save dequal\n```\n\n## Modes\n\nThere are two \"versions\" of `dequal` available:\n\n#### `dequal`\n\u003e **Size (gzip):** 489 bytes\u003cbr\u003e\n\u003e **Availability:** [CommonJS](https://unpkg.com/dequal/dist/index.js), [ES Module](https://unpkg.com/dequal/dist/index.mjs), [UMD](https://unpkg.com/dequal/dist/index.min.js)\n\n#### `dequal/lite`\n\u003e **Size (gzip):** 304 bytes\u003cbr\u003e\n\u003e **Availability:** [CommonJS](https://unpkg.com/dequal/lite/index.js), [ES Module](https://unpkg.com/dequal/lite/index.mjs)\n\n|  | IE9+ | Number | String | Date | RegExp | Object | Array | Class | Set | Map | ArrayBuffer | [TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#TypedArray_objects) | [DataView](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) |\n|-|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|\n| `dequal` | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| `dequal/lite` | :+1: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |\n\n\u003e \u003csup\u003e**Note:** Table scrolls horizontally!\u003c/sup\u003e\n\n## Usage\n\n```js\nimport { dequal } from 'dequal';\n\ndequal(1, 1); //=\u003e true\ndequal({}, {}); //=\u003e true\ndequal('foo', 'foo'); //=\u003e true\ndequal([1, 2, 3], [1, 2, 3]); //=\u003e true\ndequal(dequal, dequal); //=\u003e true\ndequal(/foo/, /foo/); //=\u003e true\ndequal(null, null); //=\u003e true\ndequal(NaN, NaN); //=\u003e true\ndequal([], []); //=\u003e true\ndequal(\n  [{ a:1 }, [{ b:{ c:[1] } }]],\n  [{ a:1 }, [{ b:{ c:[1] } }]]\n); //=\u003e true\n\ndequal(1, '1'); //=\u003e false\ndequal(null, undefined); //=\u003e false\ndequal({ a:1, b:[2,3] }, { a:1, b:[2,5] }); //=\u003e false\ndequal(/foo/i, /bar/g); //=\u003e false\n```\n\n## API\n\n### dequal(foo, bar)\nReturns: `Boolean`\n\nBoth `foo` and `bar` can be of any type.\u003cbr\u003e\nA `Boolean` is returned indicating if the two were deeply equal.\n\n\n## Benchmarks\n\n\u003e Running Node v10.13.0\n\nThe benchmarks can be found in the [`/bench`](/bench) directory. They are separated into two categories:\n\n* `basic` – compares an object comprised of `String`, `Number`, `Date`, `Array`, and `Object` values.\n* `complex` – like `basic`, but adds `RegExp`, `Map`, `Set`, and `Uint8Array` values.\n\n\u003e **Note:** Only candidates that pass validation step(s) are listed. \u003cbr\u003eFor example, `fast-deep-equal/es6` handles `Set` and `Map` values, but uses _referential equality_ while those listed use _value equality_.\n\n```\nLoad times:\n  assert             0.109ms\n  util               0.006ms\n  fast-deep-equal    0.479ms\n  lodash/isequal    22.826ms\n  nano-equal         0.417ms\n  dequal             0.396ms\n  dequal/lite        0.264ms\n\nBenchmark :: basic\n  assert.deepStrictEqual  x    325,262 ops/sec ±0.57% (94 runs sampled)\n  util.isDeepStrictEqual  x    318,812 ops/sec ±0.87% (94 runs sampled)\n  fast-deep-equal         x  1,332,393 ops/sec ±0.36% (93 runs sampled)\n  lodash.isEqual          x    269,129 ops/sec ±0.59% (95 runs sampled)\n  nano-equal              x  1,122,053 ops/sec ±0.36% (96 runs sampled)\n  dequal/lite             x  1,700,972 ops/sec ±0.31% (94 runs sampled)\n  dequal                  x  1,698,972 ops/sec ±0.63% (97 runs sampled)\n\nBenchmark :: complex\n  assert.deepStrictEqual  x    124,518 ops/sec ±0.64% (96 runs sampled)\n  util.isDeepStrictEqual  x    125,113 ops/sec ±0.24% (96 runs sampled)\n  lodash.isEqual          x     58,677 ops/sec ±0.49% (96 runs sampled)\n  dequal                  x    345,386 ops/sec ±0.27% (96 runs sampled)\n```\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","funding_links":["https://github.com/sponsors/lukeed"],"categories":["JavaScript","Packages","Utilities","Libraries"],"sub_categories":["Utility","Data Structures"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Fdequal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukeed%2Fdequal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Fdequal/lists"}