Socket
Socket
Sign inDemoInstall

react-fast-compare

Package Overview
Dependencies
0
Maintainers
21
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.2.0 to 3.2.1

11

index.js

@@ -11,3 +11,3 @@ /* global Map:readonly, Set:readonly, ArrayBuffer:readonly */

function equal(a, b) {
// START: fast-deep-equal es6/index.js 3.1.1
// START: fast-deep-equal es6/index.js 3.1.3
if (a === b) return true;

@@ -77,4 +77,9 @@

if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
// START: Modifications:
// Apply guards for `Object.create(null)` handling. See:
// - https://github.com/FormidableLabs/react-fast-compare/issues/64
// - https://github.com/epoberezkin/fast-deep-equal/issues/49
if (a.valueOf !== Object.prototype.valueOf && typeof a.valueOf === 'function' && typeof b.valueOf === 'function') return a.valueOf() === b.valueOf();
if (a.toString !== Object.prototype.toString && typeof a.toString === 'function' && typeof b.toString === 'function') return a.toString() === b.toString();
// END: Modifications

@@ -81,0 +86,0 @@ keys = Object.keys(a);

{
"name": "react-fast-compare",
"version": "3.2.0",
"version": "3.2.1",
"description": "Fastest deep equal comparison for React. Great for React.memo & shouldComponentUpdate. Also really fast general-purpose deep comparison.",

@@ -13,3 +13,2 @@ "main": "index.js",

"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\"",

@@ -20,3 +19,2 @@ "test-node-cov": "nyc mocha \"test/node/*.spec.js\"",

"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",

@@ -44,45 +42,46 @@ "size-min-gz": "yarn -s compress | gzip -9 | wc -c"

"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",
"@babel/core": "^7.21.0",
"@babel/preset-env": "^7.20.2",
"@testing-library/dom": "^9.0.1",
"@testing-library/preact": "^3.2.3",
"@types/node": "^18.15.0",
"@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",
"@types/react-redux": "^7.1.25",
"@typescript-eslint/parser": "^5.54.1",
"assert": "^2.0.0",
"babel-loader": "^9.1.2",
"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": "epoberezkin/fast-deep-equal#v3.1.1",
"jsdom": "^16.2.2",
"codecov": "^3.8.3",
"core-js": "^3.29.0",
"eslint": "^8.35.0",
"eslint-plugin-react": "^7.32.2",
"fast-deep-equal": "3.1.3",
"fast-deep-equal-git": "epoberezkin/fast-deep-equal#v3.1.3",
"jsdom": "^21.1.0",
"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": "^6.4.1",
"karma-chrome-launcher": "^3.1.1",
"karma-firefox-launcher": "^2.1.2",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-safari-launcher": "^1.0.0",
"karma-webpack": "^4.0.2",
"karma-webpack": "^5.0.0",
"lodash": "^4.17.10",
"mocha": "^6.2.2",
"mocha": "^10.2.0",
"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",
"nyc": "^15.1.0",
"preact": "^10.13.1",
"process": "^0.11.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.5",
"react-test-renderer": "^18.2.0",
"redux": "^4.2.1",
"shallow-equal-fuzzy": "0.0.2",
"sinon": "^7.5.0",
"terser": "^4.4.3",
"typescript": "^3.7.3",
"webpack": "^4.5.0"
"sinon": "^15.0.1",
"terser": "^5.16.6",
"typescript": "^4.9.5",
"webpack": "^5.76.0"
},

@@ -89,0 +88,0 @@ "nyc": {

@@ -1,7 +0,6 @@

# react-fast-compare
[![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/)
[![Downloads][downloads_img]][npm_site]
[![Bundle Size][bundle_img]](#bundle-size)
[![Travis Status][trav_img]][trav_site]
[![AppVeyor Status][appveyor_img]][appveyor_site]
[![GH Actions Status][actions_img]][actions_site]
[![Coverage Status][cov_img]][cov_site]

@@ -37,3 +36,3 @@ [![npm version][npm_img]][npm_site]

- 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.
- small: under 650 bytes minified+gzipped
- small: under 660 bytes minified+gzipped

@@ -92,3 +91,3 @@ ## Usage

The results below are from a local test on a laptop.
The results below are from a local test on a laptop _(stats last updated 6/2/2020)_:

@@ -98,8 +97,8 @@ ### Generic Data

```
react-fast-compare x 157,863 ops/sec ±0.54% (94 runs sampled)
fast-deep-equal x 149,877 ops/sec ±0.76% (93 runs sampled)
lodash.isEqual x 33,298 ops/sec ±0.70% (93 runs sampled)
nano-equal x 144,836 ops/sec ±0.51% (94 runs sampled)
shallow-equal-fuzzy x 110,192 ops/sec ±0.57% (95 runs sampled)
fastest: react-fast-compare
react-fast-compare x 177,600 ops/sec ±1.73% (92 runs sampled)
fast-deep-equal x 184,211 ops/sec ±0.65% (87 runs sampled)
lodash.isEqual x 39,826 ops/sec ±1.32% (86 runs sampled)
nano-equal x 176,023 ops/sec ±0.89% (92 runs sampled)
shallow-equal-fuzzy x 146,355 ops/sec ±0.64% (89 runs sampled)
fastest: fast-deep-equal
```

@@ -114,5 +113,5 @@

```
react-fast-compare x 64,102 ops/sec ±0.36% (94 runs sampled)
fast-deep-equal x 63,844 ops/sec ±0.43% (94 runs sampled)
lodash.isEqual x 6,243 ops/sec ±0.72% (90 runs sampled)
react-fast-compare x 86,392 ops/sec ±0.70% (93 runs sampled)
fast-deep-equal x 85,567 ops/sec ±0.95% (92 runs sampled)
lodash.isEqual x 7,369 ops/sec ±1.78% (84 runs sampled)
fastest: react-fast-compare,fast-deep-equal

@@ -160,4 +159,4 @@ ```

[trav_img]: https://api.travis-ci.com/FormidableLabs/react-fast-compare.svg
[trav_site]: https://travis-ci.com/FormidableLabs/react-fast-compare
[actions_img]: https://github.com/FormidableLabs/react-fast-compare/actions/workflows/ci.yml/badge.svg
[actions_site]: https://github.com/formidablelabs/react-fast-compare/actions/workflows/ci.yml
[cov_img]: https://codecov.io/gh/FormidableLabs/react-fast-compare/branch/master/graph/badge.svg

@@ -169,4 +168,4 @@ [cov_site]: https://codecov.io/gh/FormidableLabs/react-fast-compare

[appveyor_site]: https://ci.appveyor.com/project/FormidableLabs/react-fast-compare
[bundle_img]: https://img.shields.io/badge/minzipped%20size-639%20B-flatgreen.svg
[bundle_img]: https://img.shields.io/badge/minzipped%20size-656%20B-flatgreen.svg
[downloads_img]: https://img.shields.io/npm/dm/react-fast-compare.svg
[maintenance_img]: https://img.shields.io/badge/maintenance-active-flatgreen.svg
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc