Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Bun.deepEquals()
expect().toEqual()
const a = { a: 1, b: 2, c: { d: 3 } }; const b = { a: 1, b: 2, c: { d: 3 } }; Bun.deepEquals(a, b); // true
true
expect().toStrictEqual()
false
// undefined 值 Bun.deepEquals({}, { a: undefined }, true); // false // 数组中的 undefined Bun.deepEquals(["asdf"], ["asdf", undefined], true); // false // 稀疏数组 Bun.deepEquals([, 1], [undefined, 1], true); // false // 对象字面量与具有相同属性的实例 class Foo { a = 1; } Bun.deepEquals(new Foo(), { a: 1 }, true); // false