--- name: Check if two objects are deeply equal --- Check if two objects are deeply equal. This is used internally by `expect().toEqual()` in Bun's [test runner](/docs/test/writing). ```ts#index.ts const a = { a: 1, b: 2, c: { d: 3 } }; const b = { a: 1, b: 2, c: { d: 3 } }; Bun.deepEquals(a, b); // true ``` --- Pass `true` as a third argument to enable strict mode. This is used internally by `expect().toStrictEqual()` in Bun's [test runner](/docs/test/writing). The following examples would return `true` in non-strict mode but `false` in strict mode. ```ts // undefined values Bun.deepEquals({}, { a: undefined }, true); // false // undefined in arrays Bun.deepEquals(["asdf"], ["asdf", undefined], true); // false // sparse arrays Bun.deepEquals([, 1], [undefined, 1], true); // false // object literals vs instances w/ same properties class Foo { a = 1; } Bun.deepEquals(new Foo(), { a: 1 }, true); // false ``` --- See [Docs > API > Utils](/docs/api/utils) for more useful utilities. 91/system-store Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/setInterval.test.js (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-04-13Warn about moduleSuffixesGravatar Jarred Sumner 1-0/+6
2022-04-13[bun dev] Fix CSS HMR bugGravatar Jarred Sumner 3-71/+67
2022-04-13expose mmap size and offset option (#141)Gravatar evan 2-5/+18
2022-04-13better to fix it thereGravatar Jarred Sumner 1-2/+2
2022-04-13[bun.js] Fix bug with `readdirSync` on folders with less than 32 filesGravatar Jarred Sumner 2-8/+83
2022-04-13Update bun.d.tsGravatar Jarred Sumner 1-0/+16
2022-04-13Even More CommentsGravatar Jarred Sumner 4-8/+58
2022-04-13Support digest("base64" | "hex") in the hashingsGravatar Jarred Sumner 10-150/+752
2022-04-12[bun.js] Implement Bun.sha1, Bun.sha256, Bun.sha384, Bun.sha512, Bun.sha512_384Gravatar Jarred Sumner 11-70/+601
2022-04-12add depth limit to .gitmodules (#142)Gravatar evan 1-0/+9
2022-04-12maybe this fixes it?Gravatar Jarred Sumner 2-15/+9
2022-04-12Make sendfile more reliableGravatar Jarred Sumner 8-197/+122
2022-04-12wip fixes to sendfile() blockingGravatar Jarred Sumner 7-84/+185