fast-deep-equal
The fastest zero-dependency deep equality check for JavaScript, with Date, RegExp, Map, Set and typed-array support.
Repository Health
Technical Analysis
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-awarefast-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
Novu
Developer Tools
Open-source communication infrastructure that connects your products and AI agents to every channel your users live on — Inbox, Email, SMS, Push, Chat, and more.
Open WebUI
AI Agents · AI Assistants
The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.
OpenPanel
Analytics
Open-source Mixpanel alternative with session replay, MCP integration, and privacy-first product analytics you fully control.
Outline
Collaboration · Knowledge Management
A fast, real-time collaborative knowledge base for growing teams built on React, Node.js, and ProseMirror.
paseo
AI Agents · AI Code Assistants
One unified interface to orchestrate Claude Code, Codex, Copilot, OpenCode, and Pi agents in parallel from desktop, mobile, or the terminal.
Plasmic
CMS · Design Tools · Low Code Platforms
The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.
Plausible Analytics
Analytics
Open-source, cookie-free web analytics that respects visitor privacy and replaces Google Analytics.
Promptfoo
AI Development
An open-source CLI and library for evaluating and red-teaming LLM applications — replace trial-and-error prompt engineering with systematic evals, vulnerability scanning, and CI/CD integration.
Rivet
AI Agents · Developer Tools
Stateful actors as a primitive for AI agents, real-time collaboration, and durable execution — with in-memory state, WebSockets, queues, and scheduling built in.