deep-is

中文文档
0.1.4发布于 2021/09/05MITCommonJS零依赖近 30 天下载 5.6亿

node's assert.deepEqual algorithm except for NaN being equal to NaN

原始使用文档

deep-is

Node's assert.deepEqual() algorithm as a standalone module. Exactly like deep-equal except for the fact that deepEqual(NaN, NaN) === true.

This module is around 5 times faster than wrapping assert.deepEqual() in a try/catch.

browser support

build status

example

var equal = require('deep-is');
console.dir([
    equal(
        { a : [ 2, 3 ], b : [ 4 ] },
        { a : [ 2, 3 ], b : [ 4 ] }
    ),
    equal(
        { x : 5, y : [6] },
        { x : 5, y : 6 }
    )
]);

methods

var deepIs = require('deep-is')

deepIs(a, b)

Compare objects a and b, returning whether they are equal according to a recursive equality algorithm.

install

With npm do:

npm install deep-is

test

With npm do:

npm test

license

Copyright (c) 2012, 2013 Thorsten Lorenz [email protected] Copyright (c) 2012 James Halliday [email protected]

Derived largely from node's assert module, which has the copyright statement:

Copyright (c) 2009 Thomas Robinson <280north.com>

Released under the MIT license, see LICENSE for details.

版本与发布记录

deep-is 共发布 5 个版本,首次发布于 2013/04/11;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.1.4latest2021/09/055 年前
0.1.32014/08/2512 年前
0.1.22013/05/1213 年前
0.1.12013/04/1713 年前
0.1.02013/04/1113 年前

关于 deep-is 的常见问题

deep-is 是什么?

node's assert.deepEqual algorithm except for NaN being equal to NaN

如何安装 deep-is?

在项目目录运行 npm install deep-is,或使用 pnpm add / yarn add / bun add。

deep-is 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/deep-is 是否存在。

deep-is 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

deep-is 可以商用吗?

deep-is 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

deep-is 的下载量有多少?

根据 npm 官方下载统计,deep-is 在 2026/10/05 – 2026/11/03 这 30 天内被下载 563,294,114 次,日均约 18,776,470 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

deep-is 还在维护吗?

最新版本 0.1.4 发布于 2021/09/05(5 年前);至今共发布 5 个版本,其中过去 12 个月发布了 0 个;首次发布于 2013/04/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。