{"name":"react-fast-compare","version":"3.0.2","description":"Fastest deep equal comparison for React. Great for React.memo & shouldComponentUpdate. Also really fast general-purpose deep comparison.","main":"index.js","scripts":{"preversion":"yarn test","benchmark":"node benchmark","eslint":"eslint \"*.js\" benchmark test","test-browser":"karma start test/browser/karma.conf.js","test-browser-ie":"karma start test/browser/karma.conf.ie.js","test-node":"mocha \"test/node/*.spec.js\"","test-node-cov":"nyc yarn test-node","test-ts":"tsc --target ES5 --noImplicitAny index.d.ts","test":"builder concurrent --buffer eslint test-ts test-node-cov test-browser","test-ie":"builder concurrent --buffer eslint test-ts test-node-cov test-browser-ie","compress":"terser --compress --mangle=\"toplevel:true\" -- index.js","size-min-gz":"yarn -s compress | gzip -9 | wc -c"},"repository":{"type":"git","url":"git+https://github.com/FormidableLabs/react-fast-compare.git"},"keywords":["fast","equal","react","compare","shouldComponentUpdate","deep-equal"],"author":{"name":"Chris Bolin"},"license":"MIT","bugs":{"url":"https://github.com/FormidableLabs/react-fast-compare/issues"},"homepage":"https://github.com/FormidableLabs/react-fast-compare","devDependencies":{"@babel/core":"^7.7.5","@babel/preset-env":"^7.7.6","babel-loader":"^8.0.6","benchmark":"^2.1.4","builder":"^5.0.0","core-js":"^3.5.0","coveralls":"^3.0.9","eslint":"^6.7.2","fast-deep-equal":"3.1.1","fast-deep-equal-git":"github:epoberezkin/fast-deep-equal#v3.1.1","karma":"^4.4.1","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^1.1.0","karma-ie-launcher":"^1.0.0","karma-mocha":"^1.3.0","karma-mocha-reporter":"^2.2.5","karma-safari-launcher":"^1.0.0","karma-webpack":"^4.0.2","lodash":"^4.17.10","mocha":"^6.2.2","nano-equal":"^2.0.2","nyc":"^14.1.1","react":"^16.3.1","react-test-renderer":"^16.3.1","shallow-equal-fuzzy":"0.0.2","sinon":"^7.5.0","terser":"^4.4.3","typescript":"^3.7.3","webpack":"^4.5.0"},"nyc":{"exclude":["**/test/**","node_modules"],"reporter":["lcov","text-summary"]},"types":"index.d.ts","gitHead":"f1d2eab2ff7053b6b82c5e608f2681e133772cf9","_id":"react-fast-compare@3.0.2","_nodeVersion":"10.15.3","_npmVersion":"6.14.4","dist":{"integrity":"sha512-1fBw8Efm6fb1blbRorZcO3OqzWgxYWxXzlaNeqEVXcrDdyFzeqygrPVU6qrPuqnqYMpUJVkQBdDgDJQTmCXp+Q==","shasum":"8b0bfa93a049ec1eef9d54ab5e5c6036c317144d","tarball":"http://registry-npm.ywwl.com/react-fast-compare/download/react-fast-compare-3.0.2.tgz","fileCount":6,"unpackedSize":16878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerEwiCRA9TVsSAnZWagAAvxkP+waO08g44bFoAtJTpTbc\nUEVMk0ky6YCs0N0ta7mIgILsN5o4gTQ5xmrxG1P4QBjqatySfkFqxh0hXmIp\n5ajUoSuVfGKEKogUOrgOb4k/bEO2DNx7Q3fGxmNjtC5frzEnIgFtMQBr/+dM\nFuWQwi2dJrmQftKf3q8vge2Kcb4SqUCvQ2j7LuMdFZOkZUed6pLk7ePZdNRo\n6l1xBrXpbRrhjOorXij+KX8lQvHGulbm3kqql55bk2wAgwZUP0kYGTXlUUdp\nxL2VRPLn5cjr1q3pxfzu01xA0e4A0yLIkwB9C7MEeceOqOOUxoXVWSP8vK9r\n1aE+C4LAprgP3jjy337L6cQELp+p+SJPaQSKSDaOPLzTsiQFlxPKjGK719l+\nrm9JbvyQf03ZVVDWlZBPaFXBL6Eub9ou2j5JOzzxk8zEX9Eka2RCTZd8WVZN\nk27zRH4ddWrDvaL1b75ojw9wKc+pwD9LMviZEAQLU4qKKOAu6pFX8w/RNU8Y\n2JB/ucSB+Ah0ODF3oQ2wzMBvNkPuOaHw1rh1RfoXh0DK2yMfqPvDDe5BEvTk\n6apE+UutD96HkbOVpvqD7bT1BejcXTp3P/Mj4MSuTzgRObfCiXKpRTqdOFmb\nQc+2Ypq+wIfU2VA8xiLIdp7hG34Z5GcH9PXODuwehveWWx/sikG6nsdntxSx\nQl5L\r\n=DnuH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFZsjftkTnxoC9ps7JjjwSqeAOaciVqYIbuTmAiRGwbaAiBq0VjiRmUmG7Zo8EUeJ5iuCxBPPhMVinnsxy3xCE/fog=="}],"size":6467,"noattachment":false,"key":"/react-fast-compare/-/react-fast-compare-3.0.2.tgz"},"maintainers":[{"email":"andy.john.richardson@gmail.com","name":"andyrichardson"},{"email":"spoonart@gmail.com","name":"bmathews"},{"email":"lauren.eastridge@formidable.com","name":"boygirl"},{"email":"carbonrobot@gmail.com","name":"carbonrobot"},{"email":"me@carlos.dev","name":"carlospaelinck"},{"email":"bolin.chris@gmail.com","name":"chrisbolin"},{"email":"per@sproutlab.com","name":"coopy"},{"email":"ryan@eastridge.me","name":"eastridge"},{"email":"emma.brillhart@gmail.com","name":"ebrillhart"},{"email":"exogen@gmail.com","name":"exogen"},{"email":"admin@formidablelabs.com","name":"formidable-owner"},{"email":"npm@formidablelabs.com","name":"formidablelabs"},{"email":"brianhartz@gmail.com","name":"hartzis"},{"email":"imranolas@gmail.com","name":"imranolas"},{"email":"jrwilson@gmail.com","name":"jason.wilson"},{"email":"jmcbee1@gmail.com","name":"jmcbee1"},{"email":"kylieastewart@gmail.com","name":"kale-stew"},{"email":"kara.stubbs@formidable.com","name":"kiraarghy"},{"email":"jen.luker@formidable.com","name":"knitcodemonkey"},{"email":"kyle@kylecesmat.com","name":"kylecesmat"},{"email":"mariano.martinez@formidable.com","name":"mariano-formidable"},{"email":"monet.fulgham@formidable.com","name":"mfulgham"},{"email":"mhink1103@gmail.com","name":"mhink"},{"email":"michael@michaelmerrill.me","name":"michaelmerrill"},{"email":"parker.ziegler@formidable.com","name":"parkerziegler"},{"email":"lavalle.paula@gmail.com","name":"paulathevalley"},{"email":"phil@kitten.sh","name":"philpl"},{"email":"ryan@loose-bits.com","name":"ryan.roemer"},{"email":"ryanrray@gmail.com","name":"ryanisinallofus"},{"email":"samuelestrella226@gmail.com","name":"samwhale"},{"email":"sarahmichellemeyer@gmail.com","name":"sarmeyer"},{"email":"huynh.stefan@gmail.com","name":"stefvhuynh"},{"email":"ken_wheeler@me.com","name":"thekenwheeler"},{"email":"tyler@tylerpaulthompson.com","name":"tptee"}],"_npmUser":{"name":"kale-stew","email":"kylieastewart@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-fast-compare_3.0.2_1588349986012_0.00005888411297805263"},"_hasShrinkwrap":false,"readme":"[![React Fast Compare — Formidable, We build the modern web](https://raw.githubusercontent.com/FormidableLabs/react-fast-compare/master/react-fast-compare-Hero.png)](https://formidable.com/open-source/)\n\n[![Downloads][downloads_img]][npm_site]\n[![Bundle Size][bundle_img]](#bundle-size)\n[![GH Actions Status][actions_img]][actions_site]\n[![Coverage Status][cov_img]][cov_site]\n[![npm version][npm_img]][npm_site]\n[![Maintenance Status][maintenance_img]](#maintenance-status)\n\nThe fastest deep equal comparison for React. Very quick general-purpose deep\ncomparison, too. Great for `React.memo` and `shouldComponentUpdate`.\n\nThis is a fork of the brilliant\n[fast-deep-equal](https://github.com/epoberezkin/fast-deep-equal) with some\nextra handling for React.\n\n![benchmark chart](https://raw.githubusercontent.com/FormidableLabs/react-fast-compare/master/assets/benchmarking.png \"benchmarking chart\")\n\n(Check out the [benchmarking details](#benchmarking-this-library).)\n\n## Install\n\n```sh\n$ yarn add react-fast-compare\n# or\n$ npm install react-fast-compare\n```\n\n## Highlights\n\n- ES5 compatible; works in node.js (0.10+) and browsers (IE9+)\n- deeply compares any value (besides objects with circular references)\n- handles React-specific circular references, like elements\n- checks equality Date and RegExp objects\n- should as fast as [fast-deep-equal](https://github.com/epoberezkin/fast-deep-equal) via a single unified library, and with added guardrails for circular references.\n- small: under 660 bytes minified+gzipped\n\n## Usage\n\n```jsx\nconst isEqual = require(\"react-fast-compare\");\n\n// general usage\nconsole.log(isEqual({ foo: \"bar\" }, { foo: \"bar\" })); // true\n\n// React.memo\n// only re-render ExpensiveComponent when the props have deeply changed\nconst DeepMemoComponent = React.memo(ExpensiveComponent, isEqual);\n\n// React.Component shouldComponentUpdate\n// only re-render AnotherExpensiveComponent when the props have deeply changed\nclass AnotherExpensiveComponent extends React.Component {\n  shouldComponentUpdate(nextProps) {\n    return !isEqual(this.props, nextProps);\n  }\n  render() {\n    // ...\n  }\n}\n```\n\n## Do I Need `React.memo` (or `shouldComponentUpdate`)?\n\n> What's faster than a really fast deep comparison? No deep comparison at all.\n\n—This Readme\n\nDeep checks in `React.memo` or a `shouldComponentUpdate` should not be used blindly.\nFirst, see if the default\n[React.memo](https://reactjs.org/docs/react-api.html#reactmemo) or\n[PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)\nwill work for you. If it won't (if you need deep checks), it's wise to make\nsure you've correctly indentified the bottleneck in your application by\n[profiling the performance](https://reactjs.org/docs/optimizing-performance.html#profiling-components-with-the-chrome-performance-tab).\nAfter you've determined that you _do_ need deep equality checks and you've\nidentified the minimum number of places to apply them, then this library may\nbe for you!\n\n## Benchmarking this Library\n\nThe absolute values are much less important than the relative differences\nbetween packages.\n\nBenchmarking source can be found\n[here](https://github.com/FormidableLabs/react-fast-compare/blob/master/benchmark/index.js).\nEach \"operation\" consists of running all relevant tests. The React benchmark\nuses both the generic tests and the react tests; these runs will be slower\nsimply because there are more tests in each operation.\n\nThe results below are from a local test on a laptop _(stats last updated 6/2/2020)_:\n\n### Generic Data\n\n```\nreact-fast-compare x 177,600 ops/sec ±1.73% (92 runs sampled)\nfast-deep-equal x 184,211 ops/sec ±0.65% (87 runs sampled)\nlodash.isEqual x 39,826 ops/sec ±1.32% (86 runs sampled)\nnano-equal x 176,023 ops/sec ±0.89% (92 runs sampled)\nshallow-equal-fuzzy x 146,355 ops/sec ±0.64% (89 runs sampled)\n  fastest: fast-deep-equal\n```\n\n`react-fast-compare` and `fast-deep-equal` should be the same speed for these\ntests; any difference is just noise. `react-fast-compare` won't be faster than\n`fast-deep-equal`, because it's based on it.\n\n### React and Generic Data\n\n```\nreact-fast-compare x 86,392 ops/sec ±0.70% (93 runs sampled)\nfast-deep-equal x 85,567 ops/sec ±0.95% (92 runs sampled)\nlodash.isEqual x 7,369 ops/sec ±1.78% (84 runs sampled)\n  fastest: react-fast-compare,fast-deep-equal\n```\n\nTwo of these packages cannot handle comparing React elements, because they\ncontain circular reference: `nano-equal` and `shallow-equal-fuzzy`.\n\n### Running Benchmarks\n\n```sh\n$ yarn install\n$ yarn run benchmark\n```\n\n## Differences between this library and `fast-deep-equal`\n\n`react-fast-compare` is based on `fast-deep-equal`, with some additions:\n\n- `react-fast-compare` has `try`/`catch` guardrails for stack overflows from undetected (non-React) circular references.\n- `react-fast-compare` has a _single_ unified entry point for all uses. No matter what your target application is, `import equal from 'react-fast-compare'` just works. `fast-deep-equal` has multiple entry points for different use cases.\n\nThis version of `react-fast-compare` tracks `fast-deep-equal@3.1.1`.\n\n## Bundle Size\n\nThere are a variety of ways to calculate bundle size for JavaScript code.\nYou can see our size test code in the `compress` script in\n[`package.json`](https://github.com/FormidableLabs/react-fast-compare/blob/master/package.json).\n[Bundlephobia's calculation](https://bundlephobia.com/result?p=react-fast-compare) is slightly higher,\nas they [do not mangle during minification](https://github.com/pastelsky/package-build-stats/blob/v6.1.1/src/getDependencySizeTree.js#L139).\n\n## License\n\n[MIT](https://github.com/FormidableLabs/react-fast-compare/blob/readme/LICENSE)\n\n## Contributing\n\nPlease see our [contributions guide](./CONTRIBUTING.md).\n\n## Maintenance Status\n\n**Active:** Formidable is actively working on this project, and we expect to continue for work for the foreseeable future. Bug reports, feature requests and pull requests are welcome.\n\n[actions_img]: https://github.com/FormidableLabs/react-fast-compare/actions/workflows/ci.yml/badge.svg\n[actions_site]: https://github.com/formidablelabs/react-fast-compare/actions/workflows/ci.yml\n[cov_img]: https://codecov.io/gh/FormidableLabs/react-fast-compare/branch/master/graph/badge.svg\n[cov_site]: https://codecov.io/gh/FormidableLabs/react-fast-compare\n[npm_img]: https://badge.fury.io/js/react-fast-compare.svg\n[npm_site]: http://badge.fury.io/js/react-fast-compare\n[appveyor_img]: https://ci.appveyor.com/api/projects/status/github/formidablelabs/react-fast-compare?branch=master&svg=true\n[appveyor_site]: https://ci.appveyor.com/project/FormidableLabs/react-fast-compare\n[bundle_img]: https://img.shields.io/badge/minzipped%20size-656%20B-flatgreen.svg\n[downloads_img]: https://img.shields.io/npm/dm/react-fast-compare.svg\n[maintenance_img]: https://img.shields.io/badge/maintenance-active-flatgreen.svg\n","publish_time":1588349986125,"_cnpm_publish_time":1588349986125,"dist-tags":{"beta":"3.0.0-beta.1","latest":"3.2.4","next":"3.2.3-canary-20261105232110"}}