{"_id":"@bybrave/fast-deep-equal2","name":"@bybrave/fast-deep-equal2","dist-tags":{"latest":"4.0.0"},"versions":{"4.0.0":{"name":"@bybrave/fast-deep-equal2","version":"4.0.0","description":"Maintained fork of fast-deep-equal — fast deep equality with the null-prototype crash fixed (#49), a circular-safe variant (#17), Map/Set/TypedArray support built in, ESM, and bundled types","type":"module","main":"./dist/index.cjs","module":"./index.js","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./dist/index.cjs"},"./react":{"types":"./react.d.ts","import":"./react.js","require":"./dist/react.cjs"},"./package.json":"./package.json"},"scripts":{"build":"node build/build.js","test":"node --test test/*.test.js","test-types":"tsc --noEmit --strict test/type-declarations.ts","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/bybraveHQ/fast-deep-equal2.git"},"bugs":{"url":"https://github.com/bybraveHQ/fast-deep-equal2/issues"},"homepage":"https://github.com/bybraveHQ/fast-deep-equal2#readme","keywords":["fast","deep","equal","equality","compare","deepequal","circular","react","esm","typescript"],"author":{"name":"bybrave","url":"https://github.com/bybraveHQ"},"contributors":[{"name":"Evgeny Poberezkin","url":"author of the original fast-deep-equal"}],"license":"MIT","funding":"https://ko-fi.com/bybrave","engines":{"node":">=18"},"devDependencies":{"@types/node":"^20.14.0","esbuild":"^0.23.0","typescript":"^5.5.0"},"_id":"@bybrave/fast-deep-equal2@4.0.0","gitHead":"fdf5796cd6c6999bc2dc3a8799217dad528110ff","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-splTjwW0GFiuJEwq5cg55A0t+YzXGd7ri8THf+MQfSW/yjPRrKbyAWpcKszacz5Kq0JlRyjx9pTBxcS6DbrElg==","shasum":"a5d348251d571b1dce6d69297d11d76705bd1a28","tarball":"https://registry.npmjs.org/@bybrave/fast-deep-equal2/-/fast-deep-equal2-4.0.0.tgz","fileCount":9,"unpackedSize":17767,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAZOyNKcC0gs9pgwcT9ijrqmf63ybjPEgo9Fy8PBCb9RAiEApl2ha+sg//g+LPajN/znpJ3hLi9u21RAIVau3a3RKk4="}]},"_npmUser":{"name":"bybrave","email":"opmybrave@gmail.com"},"directories":{},"maintainers":[{"name":"bybrave","email":"opmybrave@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fast-deep-equal2_4.0.0_1783254256854_0.7390773050922623"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-05T12:24:16.699Z","4.0.0":"2026-07-05T12:24:16.995Z","modified":"2026-07-05T12:24:17.176Z"},"maintainers":[{"name":"bybrave","email":"opmybrave@gmail.com"}],"description":"Maintained fork of fast-deep-equal — fast deep equality with the null-prototype crash fixed (#49), a circular-safe variant (#17), Map/Set/TypedArray support built in, ESM, and bundled types","homepage":"https://github.com/bybraveHQ/fast-deep-equal2#readme","keywords":["fast","deep","equal","equality","compare","deepequal","circular","react","esm","typescript"],"repository":{"type":"git","url":"git+https://github.com/bybraveHQ/fast-deep-equal2.git"},"contributors":[{"name":"Evgeny Poberezkin","url":"author of the original fast-deep-equal"}],"author":{"name":"bybrave","url":"https://github.com/bybraveHQ"},"bugs":{"url":"https://github.com/bybraveHQ/fast-deep-equal2/issues"},"license":"MIT","readme":"# @bybrave/fast-deep-equal2\n\nMaintained, drop-in fork of [`fast-deep-equal`](https://github.com/epoberezkin/fast-deep-equal) — the fastest deep-equality check for JavaScript.\n\nThe original has had no release since 2020 (`3.1.3`) while still pulling ~710M downloads/month. This fork fixes the null-prototype crash, adds a circular-safe variant, folds Map/Set/TypedArray support into the default function, and ships ESM plus improved bundled types.\n\n```sh\nnpm install @bybrave/fast-deep-equal2\n```\n\n```js\nconst equal = require('@bybrave/fast-deep-equal2');   // CommonJS\nimport equal from '@bybrave/fast-deep-equal2';         // ESM\nimport { equal, react, circular } from '@bybrave/fast-deep-equal2';\n\nequal({ a: 1, b: [2, 3] }, { a: 1, b: [2, 3] }); // true\n```\n\nThe default `equal(a, b)` is the same fast function as upstream, and remains a TypeScript type guard (`a is T`). Map, Set, TypedArray and BigInt are compared out of the box — no separate `es6` entry needed.\n\n## What's fixed\n\n| Issue | Problem | Fix |\n|---|---|---|\n| [#49](https://github.com/epoberezkin/fast-deep-equal/issues/49) / [#111](https://github.com/epoberezkin/fast-deep-equal/issues/111) | Comparing objects created with `Object.create(null)` threw `a.valueOf is not a function` (21+ 👍). | `valueOf`/`toString` are only called when the object actually overrides them and they're callable — null-prototype objects compare by their own keys instead. |\n| [#17](https://github.com/epoberezkin/fast-deep-equal/issues/17) | Circular references caused a `RangeError` (stack overflow). | New `circular` export tracks visited pairs and handles cycles. The default `equal` stays allocation-free and fast. |\n| [#81](https://github.com/epoberezkin/fast-deep-equal/issues/81) | Type fixes weren't shipped. | Bundled, improved types (default + `react` + `circular`), verified with `tsc --strict`. |\n| — | Map/Set/TypedArray lived in a separate `es6` entry. | Folded into the default function (Node 18+ has them). |\n\n## Exports\n\n- **`equal(a, b)`** (default) — fast deep equality, Map/Set/TypedArray/BigInt aware, null-prototype safe. Throws on circular references (use `circular` for those).\n- **`circular(a, b)`** — same, but safe against circular references (tracks visited object pairs; slightly slower).\n- **`react(a, b)`** — ignores React elements' circular `_owner`. Also available as the subpath `@bybrave/fast-deep-equal2/react` for drop-in parity with `fast-deep-equal/react`.\n\n## Migration from `fast-deep-equal`\n\nReplace the dependency and the import. `equal` behaves the same, except comparing `Object.create(null)` objects now works instead of throwing. If you imported `fast-deep-equal/es6`, just use the default — Map/Set/TypedArray are built in. `fast-deep-equal/react` → `@bybrave/fast-deep-equal2/react`.\n\n## Support\n\nIf this package saves you time, you can support maintenance:\n\n[![Ko-fi](https://img.shields.io/badge/Ko--fi-buy%20me%20a%20coffee-FF5E5B?logo=kofi&logoColor=white)](https://ko-fi.com/bybrave)\n[![Bitcoin](https://img.shields.io/badge/Bitcoin-BTC-F7931A?logo=bitcoin&logoColor=white)](#support)\n\nBitcoin (BTC): `bc1q37557q5jpeaxqydzwvf3jgj7zhnfpn2td3q40q`\n\n## Credits & license\n\nMIT, same as the original — see [LICENSE](./LICENSE).\nBased on [fast-deep-equal](https://github.com/epoberezkin/fast-deep-equal) by Evgeny Poberezkin.\n","readmeFilename":"README.md","_rev":"1-8d04609d4740e6c6106e426364bf8627"}