dequal

A tiny (304B to 489B gzipped), zero-dependency utility for deep equality checks in JavaScript.

Library
npm
v2.0.3
1,467stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
44/100Fair
Development Activity8
Maintenance20
Community48
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
69/100Good
Architecture78
Code Quality78
Innovation85
Learning Curve35

dequal is a minimal deep-equality utility for JavaScript that compares any two values — primitives, Objects, Arrays, Dates, RegExps, Functions, class instances, Sets, Maps, ArrayBuffers, TypedArrays, and DataViews — for structural equality rather than reference equality. It ships as two builds: the full dequal (489 bytes gzipped) and a dequal/lite variant (304 bytes gzipped) that drops Set/Map/TypedArray/ArrayBuffer support for projects that don’t need it.

Under the hood it recursively dispatches on each value’s constructor rather than relying on JSON serialization or a fixed list of type checks, so it correctly handles NaN equality, key-order-independent object comparison, order-sensitive array comparison, and value-based (not referential) equality within Sets and Maps, including object keys inside a Map. Both builds ship as CommonJS, ESM, and (for the default build) UMD, with zero runtime dependencies.

What You Get

  • Two entry points — the full dequal and the ultra-minimal dequal/lite — so you only pay for the features you use
  • Zero runtime dependencies and sub-500-byte gzipped builds, published as CommonJS, ESM, and UMD
  • Correct handling of NaN, key order in objects, item order in arrays, and value-based equality for Set/Map contents
  • Full TypeScript type definitions included out of the box

Common Use Cases

  • Comparing props or state snapshots in a UI framework to decide whether to re-render
  • Asserting deep equality of complex fixtures in unit tests
  • Memoizing expensive computations by comparing function arguments across calls
  • Deduplicating arrays or objects fetched from an API before storing them

Under The Hood

Architecture dequal is a single pure recursive function (src/index.js) that short-circuits on ===, then dispatches by comparing foo.constructor === bar.constructor and branching per type (Date, RegExp, Array, Set, Map, ArrayBuffer, DataView, typed arrays, plain objects), using a private find() helper to do value-based lookups when Set/Map keys are themselves objects. src/lite.js is not a thin wrapper around the default build but a deliberately separate, smaller reimplementation that omits Set/Map/TypedArray/ArrayBuffer handling — a real architectural trade-off where a correctness fix to the core walk must be applied in both files or the two modes silently diverge. There is no class, no configuration object, and no state; the entire surface area is one exported function per mode, which keeps the abstraction easy to reason about despite the duplication risk.

Tech Stack The package has zero runtime dependencies. Its only devDependencies are bundt (a zero-config bundler that reads the modes field in package.json to emit dist/index.js (CJS), dist/index.mjs (ESM), and dist/index.min.js (UMD) for the default mode, and separate CJS/ESM output for lite), esm (lets import/export syntax run under Node’s classic CommonJS loader for tests), and uvu (a minimalist, fast test runner) with uvu/assert. Type definitions are hand-written in a single shared index.d.ts rather than generated from source. CI (GitHub Actions, .github/workflows/ci.yml) runs the test suite across Node 8, 10, 12, and 18, and on Node 18 also collects coverage via c8 and reports it to Codecov. The package is distributed to npm as a dual CJS/ESM package and to unpkg for direct browser use via the UMD build.

Code Quality test/index.js and test/lite.js form an unusually thorough suite for a ~50-line function: scalars (including NaN, -0, Infinity), objects (key-order independence, undefined-vs-missing-key distinctions, null-prototype dictionaries), arrays (order sensitivity), Dates, RegExps (flag sensitivity), Functions (referential-only equality), classes (own properties vs. prototype members, getters, default constructor parameters), Maps and Sets (flat, nested, object-valued keys, insertion-order independence), and TypedArrays/Buffer/ArrayBuffer/DataView — the tests effectively double as the specification. There is no TypeScript compiler enforcing correctness (types are hand-authored) and no linter or formatter configuration in the repo, but the CI matrix spanning four Node versions plus coverage reporting is a solid quality signal for a project this small.

API Design The public API is a single named export, dequal(foo, bar): boolean, with zero configuration and zero setup required. The README documents a clear compatibility matrix between the dequal and dequal/lite builds and includes benchmark comparisons against fast-deep-equal, lodash.isEqual, and Node’s built-in util.isDeepStrictEqual, giving consumers concrete grounds to choose a build. Bundled TypeScript definitions mean consumers get autocomplete and type-checking without an extra @types package. The one DX rough edge is the two-mode split itself — picking dequal/lite silently drops Set/Map/TypedArray support, which is documented but easy to miss.

Used by 8 apps in this directory

JavaScript
47%
MIT

Ghost

CMS · Blogging

55,191

Open source headless Node.js CMS for professional publishing, paid memberships, and newsletters with a fully owned audience.

View details
96
Repo Health
85
Technical
67
Dependency
Built with
JavaScript47%
TypeScript47%
Updated yesterday
Python
61%
Apache 2.0

marimo

Developer Tools · Data Engineering

22,670

A reactive Python notebook that eliminates hidden state, runs reproducibly, and deploys as a web app or script — stored as pure Python, built for the AI era.

View details
90
Repo Health
91
Technical
65
Dependency
Built with
Python61%
TypeScript37%
Updated yesterday
TypeScript
96%
MIT

Payload CMS

Developer Tools · Blogging · CMS

44,600

The open-source, Next.js-native headless CMS that lives inside your /app folder and gives you a full TypeScript backend instantly.

View details
91
Repo Health
88
Technical
65
Dependency
Built with
TypeScript96%
Updated 3 days ago
TypeScript
99%
Other

Teable

Databases · No Code Platforms

21,759

A no-code PostgreSQL database with spreadsheet UX, real-time collaboration, and native AI agents — built for teams that outgrow Airtable.

View details
79
Repo Health
76
Technical
63
Dependency
Built with
TypeScript99%
Updated today
TypeScript
99%
Apache 2.0

Trigger.dev

Automation · AI Development · Developer Tools

16,223

Build and deploy fully-managed AI agents and background jobs in TypeScript — with no timeouts, durable retries, real-time observability, and elastic scaling built in.

View details
90
Repo Health
9
Technical
63
Dependency
Built with
TypeScript99%
Updated today
TypeScript
64%
Other

Typebot

Developer Tools · AI Development · No Code Platforms

10,313

Build sophisticated chatbots visually, embed them anywhere without iframes, and own your data — fully self-hostable with a modular block system and 30+ integrations.

View details
93
Repo Health
82
Technical
65
Dependency
Built with
TypeScript64%
MDX35%
Updated 2 days ago
TypeScript
63%
AGPL 3.0

undb

No Code Platforms · Databases

2,977

Self-hosted no-code database and BaaS that lets you manage structured data visually with multi-database support, formula fields, and auto-generated OpenAPI endpoints.

View details
47
Repo Health
66
Technical
66
Dependency
Built with
TypeScript63%
Svelte35%
Updated 1 years ago
TypeScript
97%
Apache 2.0

Unleash

Developer Tools · Devops · Ab Testing Experimentation

13,787

The open-source feature management platform that lets you ship code to production and control who sees it — without redeploying.

View details
91
Repo Health
84
Technical
70
Dependency
Built with
TypeScript97%
Updated today

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

Search