Skip to content

Commit

Permalink
fix: deepEqual() do not distinguish null and undefined by default
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Dec 12, 2022
1 parent f40bc44 commit db8c96b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cosmokit",
"description": "A collection of common utilities",
"version": "1.3.4",
"version": "1.3.6",
"sideEffects": false,
"main": "lib/index.cjs",
"module": "lib/index.mjs",
Expand Down
3 changes: 2 additions & 1 deletion src/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ export function clone(source: any) {
return valueMap(source, clone)
}

export function deepEqual(a: any, b: any): boolean {
export function deepEqual(a: any, b: any, strict?: boolean): boolean {
if (a === b) return true
if (!strict && isNullable(a) && isNullable(b)) return true
if (typeof a !== typeof b) return false
if (typeof a !== 'object') return false
if (!a || !b) return false
Expand Down

0 comments on commit db8c96b

Please sign in to comment.