Skip to documentation

package

@stackline/deep-is 1.0.6 — installation and API

Stack-safe deep equality with the proven deep-is 0.1.4 semantics

Install @stackline/deep-is

npm install @stackline/[email protected]

Package version: 1.0.6. Metadata verified: 2026-11-12. This is separate from the framework version and demonstration runtime.

Node.js requirement
{"node": ">=12"}
Accepted peer dependencies (declared ranges)
{}

Tested environments are described in the versioned README and linked source checks. A declared peer range is not evidence that every version in it was tested.

Versioned reference

This reference comes from the published @stackline/[email protected] README. Its upstream attribution and license remain with the source. Benchmark and security statements describe the cited tests and advisories, not a guarantee for every application.

@stackline/deep-is

Stack-safe deep equality with the proven deep-is 0.1.4 semantics.

Documentation | npm | Issues | Repository

Current package version: 1.0.6


Why this package?

Stack-safe deep equality with the established [email protected] behavior.

This package is an independent, maintained continuation of deep-is. It keeps the callable API and its intentionally loose compatibility semantics while handling cyclic and very deep object graphs without recursive call-stack exhaustion.

Provenance

The upstream source and authorship history are documented in UPSTREAM_AUDIT.md and NOTICE. The Stackline fork is not affiliated with or endorsed by the original authors.

Compatibility

Item Value
Package @stackline/[email protected]
Node.js runtime >=12
CommonJS / primary entry ./index.js
ES module entry ./index.mjs
Type declarations ./index.d.ts
  • CommonJS and native ESM
  • First-party TypeScript declarations, including TypeScript 3.9 consumers
  • Browser bundle entry points
  • Node.js 12 and newer at runtime
  • Zero runtime dependencies

See COMPATIBILITY_CONTRACT.md and MIGRATION.md for the exact boundary and alias migration.

Installation

Install

npm install @stackline/deep-is

Preserve an existing require('deep-is') without changing application code:

npm install deep-is@npm:@stackline/deep-is

Usage

CommonJS

const deepIs = require('@stackline/deep-is');

deepIs({ answer: 42 }, { answer: '42' }); // true
deepIs(+0, -0); // false
deepIs(NaN, NaN); // true

ESM

import deepIs from '@stackline/deep-is';

const left = { id: 1 };
const right = { id: '1' };
left.self = left;
right.self = right;

deepIs(left, right); // true

Features and Integrations

Reliability

The original recursive algorithm can throw RangeError for equivalent cycles or sufficiently deep inputs. This implementation uses iterative graph traversal and pair tracking. Regression coverage includes a 100,000-level object graph, cyclic graphs, and more than 5,000 differential comparisons against a frozen copy of [email protected].

There is no published CVE or GHSA claim associated with this change.

Security

Report vulnerabilities privately as described in SECURITY.md. Do not disclose an unpatched vulnerability in a public issue.

API Surface

API

deepIs(actual, expected)

Returns a boolean. Inputs are not mutated.

The package deliberately preserves the legacy contract:

  • NaN equals NaN;
  • positive and negative zero differ;
  • non-object primitive pairs use loose equality;
  • dates compare their timestamps;
  • enumerable own string keys are compared independent of order;
  • arguments objects retain their historical array comparison;
  • symbol and non-enumerable keys are outside the contract;
  • Map, Set, RegExp, and object-prototype internals are not interpreted.

Use node:util.isDeepStrictEqual or another strict comparator when new code needs strict modern semantics.

Local Development

git clone https://github.com/alexandroit/stackline-deep-is.git
cd stackline-deep-is
npm ci
npm run verify

Release tooling uses Node.js 24.20.0 and npm 11.19.0. The consumer runtime contract remains the one documented above.

Consumer Smoke Test

Run the repository's existing consumer/package check after installing development dependencies:

npm run test:smoke

Release Checklist

Run npm run verify and inspect the package contents before release. Publish a new version through the GitHub Actions publishing workflow, using the SHA-512 digest of the reviewed tarball. Verify the exact published version, tarball integrity, and npm provenance after the run.

License

MIT. Original copyright and permission notices are preserved in LICENSE.

Credits and original authors

Original copyright, license notices and contributor acknowledgements remain part of this distribution. Stackline maintenance does not replace authorship of the original work.

Use this repository's issue tracker for reproducible bugs and feature requests. Join r/Stackline for examples, usage questions and release discussions.

Examples and compatibility

The original example runtime is preserved. Its build is identified by source commit fd253ef99d5925a335069bfd656e746974c23078. Package version and runtime version must be checked independently.

Open the original example

Examples load only when requested. They have their own runtime and are separate from this reference.

Compatibility Contract — @stackline/deep-is

Migration — @stackline/deep-is