{"name":"react-fast-compare","version":"3.2.0","description":"Fastest deep equal comparison for React. Great for React.memo & shouldComponentUpdate. Also really fast general-purpose deep comparison.","main":"index.js","typings":"index.d.ts","scripts":{"preversion":"yarn test","benchmark":"node benchmark","eslint":"eslint \"*.js\" benchmark test","tslint":"eslint test/typescript/*.tsx","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 mocha \"test/node/*.spec.js\"","test-ts-usage":"tsc --esModuleInterop --jsx react --noEmit test/typescript/sample-react-redux-usage.tsx test/typescript/sample-usage.tsx","test-ts-defs":"tsc --target ES5 index.d.ts","test":"builder concurrent --buffer eslint tslint test-ts-usage test-ts-defs test-node-cov test-browser","test-ie":"builder concurrent --buffer eslint tslint test-ts-usage test-ts-defs 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","@testing-library/dom":"^7.5.1","@testing-library/preact":"^1.0.2","@types/node":"^14.0.1","@types/react":"^16.9.35","@types/react-dom":"^16.9.8","@types/react-redux":"^7.1.9","@typescript-eslint/parser":"^2.34.0","babel-loader":"^8.0.6","benchmark":"^2.1.4","builder":"^5.0.0","codecov":"^3.6.5","core-js":"^3.5.0","eslint":"^6.7.2","eslint-plugin-react":"^7.20.0","fast-deep-equal":"3.1.1","fast-deep-equal-git":"github:epoberezkin/fast-deep-equal#v3.1.1","jsdom":"^16.2.2","jsdom-global":"^3.0.2","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","preact":"^10.4.1","react":"^16.3.1","react-dom":"^16.13.1","react-redux":"^7.2.0","react-test-renderer":"^16.13.1","redux":"^4.0.5","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":"5031f5fd8094096f3aaa513c86f3c09c84ba8169","_id":"react-fast-compare@3.2.0","_nodeVersion":"10.15.3","_npmVersion":"6.14.5","dist":{"integrity":"sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==","shasum":"641a9da81b6a6320f270e89724fb45a0b39e43bb","tarball":"http://registry-npm.ywwl.com/react-fast-compare/download/react-fast-compare-3.2.0.tgz","fileCount":6,"unpackedSize":18517,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJez91yCRA9TVsSAnZWagAAwZAP/0fRT1kPykoJRvqE85+O\nULGSVsX9P/G97/4S1n7mOROKgKu3yWoozCCtLNTAHsPiPm4S5QpWz6LYNzvq\n5erNdr1opIU6sXFuqYLttpCAeMStfMEK90/etdQ2ZG2UU9/BKkrzWzoEQSqz\nlN4HzQNqse1F0Q0h7IVykBLg8oMU3N/2+IFB1AzZL1cygSRQmOGWVkXtDw4r\nl8NRTb5vO25Uy7ki7pFuL0PcP65c1iba7Smr2KXyNLXXpVDHkn0AJ6hfLPcB\nwkrMfhxY6F9s3+Pi8ELDa3wd0es8EyKt5Xa1JJAG9A58A1DISNxA9n+gCbMg\nnjan7RZOTglnSaLjFWQk6f7vWCVLFbHFA5hXH12yQcw/pRKo2+gY/7LOFkR6\nmxpELyYXxkSJmTk00kX5Cd/A6UiGRsuSwNocnJEUyDLfVPCBj96HxWfnqjui\noXxiZ16BAOkwEHpz6PSsLEAvmLlrX/b7Mydaruj9K/GtmYmwl0G2lnCneaIX\ndKVCQ1kQPqW498b1ADg9jj/yCGZCkyzaH/+HfOCMfZSb2GyUymbHv3luPAKS\nNkeXt3m3Y11HHidaQgBcIzPnuQ0nahZnS1P1S5l0sWEuztfc2mlswuca+dlR\nap98K7VBHhd8icFH/tO1mYokw0HoR9+THK0bLXQmJNOobITqPStenUnlKlD0\nNjlE\r\n=u4az\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkJhK9Py+KeatwSlFmpT62nwmMj6fGxnKl3LLHP7bj0AIgPDkYUY/PHJeyktFcTVghm8hKw6UR0Ezus0Hi4wpRXf0="}],"size":6906,"noattachment":false,"key":"/react-fast-compare/-/react-fast-compare-3.2.0.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.2.0_1590680945520_0.6117256694673183"},"_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":1590680945777,"_cnpm_publish_time":1590680945777,"dist-tags":{"beta":"3.0.0-beta.1","latest":"3.2.4","next":"3.2.3-canary-20261105232110"}}