fast-deep-equal

The fastest zero-dependency deep equality check for JavaScript, with Date, RegExp, Map, Set and typed-array support.

Library
npm
v3.1.3
2,049 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
43 /100 Fair
Development Activity 0
Maintenance 20
Community 52
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
87 /100 Excellent
Architecture 80
Code Quality 85
Innovation 88
Learning Curve 95

fast-deep-equal is a tiny, zero-dependency JavaScript library that performs the fastest possible deep equality comparison between two arbitrary values. It recursively walks objects and arrays and compares Date and RegExp instances by value, returning a simple boolean.

Beyond the default ES5-compatible build, an optional ES6 variant adds equality for Maps, Sets, and typed arrays, and a React-aware variant skips the circular _owner property on React elements. It is one of the most widely depended-on packages on npm, used internally by validators, memoization helpers, and UI libraries.

What You Get

  • A single equal(a, b) function that returns a boolean for deep structural equality.
  • Multiple prebuilt entry points: default (ES5), fast-deep-equal/es6, and React-aware fast-deep-equal/react.
  • Correct value comparison for Date and RegExp objects, plus optional Map, Set, and typed-array support in the ES6 build.
  • TypeScript type definitions with a type-guard signature (actual is T).
  • Zero runtime dependencies and a footprint small enough to inline into any bundle.

Common Use Cases

  • Skipping unnecessary re-renders in UI frameworks by comparing previous and next props or state.
  • Deduplicating or diffing configuration and API response objects.
  • Powering memoization and caching layers that key on structural equality.
  • Writing assertions and equality checks inside test helpers and validators.

Under The Hood

Architecture

The entire library is a single recursive equal(a, b) function. It short-circuits on reference identity, then, for two objects sharing a constructor, branches by shape: arrays are compared element-by-element in a reverse-counting loop, RegExps by source/flags, and any object with a custom valueOf/toString by that value, before falling back to key-by-key recursion over Object.keys. NaN is treated as equal to NaN. All builds are generated from one src/index.jst doT template by build.js, which stamps out the ES5 default (index.js), the ES6 variant with Map/Set/typed-array branches, and React variants that skip the circular _owner property.

Tech Stack

Plain ES5 JavaScript with no runtime dependencies. Build tooling is minimal: the dot templating engine generates the distributable files, ESLint enforces style, and TypeScript is used only to type-check the shipped index.d.ts. Tests run on Mocha with nyc for coverage. The published package ships index.js, react.js, es6/, and .d.ts type definitions.

Code Quality

The implementation is a compact, carefully ordered set of type checks with performance-motivated idioms (reverse for loops, early returns). A data-driven spec suite (spec/tests.js, spec/es6tests.js) exercises scalars, nested structures, special objects, Maps, Sets, typed arrays, and React elements, and the project reports coverage via nyc/coveralls. Because the runtime files are template-generated, contributors edit src/index.jst rather than the .js outputs directly.

API Design The developer experience is essentially frictionless: a single default export called with two arguments returns a boolean, and the three entry points (fast-deep-equal, fast-deep-equal/es6, fast-deep-equal/react) let consumers opt into exactly the type support they need. The TypeScript signature doubles as a type guard (actual is T), and the README documents install, usage, and benchmarks concisely. There is no configuration or setup boilerplate.

Used by 32 apps in this directory

TypeScript
77%
Other

Joplin

Note Taking

56,853

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
60
Dependency
Built with
TypeScript 77%
JavaScript 14%
Updated 6 days ago
TypeScript
99%
MIT

KeystoneJS

CMS · Developer Tools

9,980

The superpowered headless CMS for developers built with GraphQL and React

View details
92
Repo Health
81
Technical
64
Dependency
Built with
TypeScript 99%
Updated 6 days ago
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,338

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 98%
Updated 5 days ago
TypeScript
98%
Other

LobeHub

AI Assistants · Automation · Productivity

83,455

Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.

View details
92
Repo Health
81
Technical
65
Dependency
Built with
TypeScript 98%
Updated 5 days ago
Clojure
71%
AGPL 3.0

Logseq

Knowledge Management · Note Taking

45,349

A privacy-first, open-source knowledge graph platform combining Markdown, Org-mode, bidirectional linking, and local-first storage for building your second brain.

View details
92
Repo Health
82
Technical
65
Dependency
Built with
Clojure 71%
OCaml 12%
Updated 6 days ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

29,041

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
90
Repo Health
73
Technical
65
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
51%
Other

Mattermost

Collaboration · Devops · Team Chat

39,418

Open core, self-hosted team collaboration with chat, AI agents, voice calling, and deep DevOps integrations — all under your control.

View details
96
Repo Health
87
Technical
65
Dependency
Built with
TypeScript 51%
Go 40%
Updated 5 days ago
TypeScript
65%
Other

NocoDB

Databases · Low Code Platforms · No Code Platforms

65,340

Turn any SQL database into a collaborative no-code spreadsheet with automatic REST APIs and real-time views.

View details
91
Repo Health
77
Technical
63
Dependency
Built with
TypeScript 65%
Vue 30%
Updated 5 days ago
TypeScript
99%
Apache 2.0

Nordcraft

Low Code Platforms · No Code Platforms

492

Build high-performance server-rendered web apps with a visual editor, formula engine, and self-hostable backend — all in TypeScript.

View details
84
Repo Health
81
Technical
74
Dependency
Built with
TypeScript 99%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers