{"name":"react-fast-compare","version":"2.0.4","description":"Fastest deep equal comparison for React. Perfect for shouldComponentUpdate. Also really fast general-purpose deep comparison","main":"index.js","scripts":{"preversion":"npm run 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 npm run 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"},"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":"^6.26.0","babel-loader":"^7.1.4","babel-preset-env":"^1.6.1","benchmark":"^2.1.4","builder":"^4.0.0","core-js":"^2.5.5","coveralls":"^2.13.1","eslint":"^4.0.0","fast-deep-equal":"2.0.1","karma":"^2.0.0","karma-chrome-launcher":"^2.2.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":"^3.0.0","lodash":"^4.17.10","mocha":"^3.4.2","nano-equal":"^2.0.2","nyc":"^11.0.2","react":"^16.3.1","react-test-renderer":"^16.3.1","shallow-equal-fuzzy":"0.0.2","sinon":"^4.5.0","typescript":"^2.6.1","webpack":"^4.5.0"},"nyc":{"exclude":["**/test/**","node_modules"],"reporter":["lcov","text-summary"]},"types":"index.d.ts","gitHead":"443b956f01a71bdbcd0e1769fc489caf203a26a3","_id":"react-fast-compare@2.0.4","_npmVersion":"5.8.0","_nodeVersion":"8.3.0","_npmUser":{"name":"chrisbolin","email":"bolin.chris@gmail.com"},"dist":{"integrity":"sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==","shasum":"e84b4d455b0fec113e0402c329352715196f81f9","tarball":"http://registry-npm.ywwl.com/react-fast-compare/download/react-fast-compare-2.0.4.tgz","fileCount":5,"unpackedSize":11474,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5cbYCRA9TVsSAnZWagAApTwP/1qyYxkPey18FWK8W5De\n2gfNyd5TmluaMhHcbR6tj0mfR0pYxmQ42vNovw10BdUGTXAR2jgZ3i2U4wtX\npBadjeFhcqXENrOY1BUC4fM+VqpIhro+2cjkM9O2fQYEckkkGGatl74MacfM\nVmvdrVw8irW/Re7sBpYKKOgq166meXW38BMC6hkO/3Nc8odCqgKd0tjLfTyF\n54PPSeIp+boLFOQm+vEw5bDTnBjDqufnfqqvIQ6Fyp2xFGyDjZqe2YD8B/HY\nEnRLx+qqgs2L2y0a1Aow9opx0AwwtkaQpJ3Rb9PXARC5597q8AYYquUKUT7o\n4T0lyFg0F3JrY0l+gjtsUohZYMLIa3Ok2NTRdd61dL0/gwDqHf2Idl6MoiM7\n4HuDlBiijnauQ6l36jrvCIPv/esftOX5b+CYDYhKsnWiAw4XQdsgIVPDQ1z+\n5Q+REsO0CRsboLgcuhIfKTyPKvZXxhdGIJBLKaoBWvvUm9Na3ONdFYWa0WBK\nptupZ5iLk0l59fIWkZe7K++lY0crq/YH6XEKc8Ijk/M1FtZWCF2e1I0VjhjA\nsgGfbOMNG2CaTFmT/ckhN7kPTLRlZUJt9mGQYu+EZBeOPu92ISZC+/9S2XXV\nc1moTSxzcmvnRmmPrnWhut5DQl2yBUziocUVNKJWoqGuIPLNacsH+VQDn4LD\nbNev\r\n=f/9W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA8BerHG+gxfUq3cXYR7hEZuOZGkUuDg4pN2f7oQzw2rAiEA9XXzXXlolCowROZQ3UQM79BYE2f1yezJMYYz3coKmdU="}],"size":4691,"noattachment":false,"key":"/react-fast-compare/-/react-fast-compare-2.0.4.tgz"},"maintainers":[{"email":"alexjrsaunders@gmail.com","name":"alex-saunders"},{"email":"me@ericbaer.com","name":"baer"},{"email":"spoonart@gmail.com","name":"bmathews"},{"email":"lauren.eastridge@formidable.com","name":"boygirl"},{"email":"carlos@carlospaelinck.com","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":"imranolas@gmail.com","name":"imranolas"},{"email":"jrwilson@gmail.com","name":"jason.wilson"},{"email":"kylieastewart@gmail.com","name":"kale-stew"},{"email":"jen.luker@formidable.com","name":"knitcodemonkey"},{"email":"kyle@kylecesmat.com","name":"kylecesmat"},{"email":"mariano.martinez@formidable.com","name":"mariano-formidable"},{"email":"mhink1103@gmail.com","name":"mhink"},{"email":"michael@michaelmerrill.io","name":"michaelmerrill"},{"email":"parker.ziegler@formidable.com","name":"parkerziegler"},{"email":"lavalle.paula@gmail.com","name":"paulathevalley"},{"email":"redfield.stefan@gmail.com","name":"redfieldstefan"},{"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"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-fast-compare_2.0.4_1541785303782_0.9394789592952855"},"_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":1541785303891,"_cnpm_publish_time":1541785303891,"dist-tags":{"beta":"3.0.0-beta.1","latest":"3.2.4","next":"3.2.3-canary-20261105232110"}}