diff --git a/src/shared/util.ts b/src/shared/util.ts index a171a743c14..78de3e90ab6 100644 --- a/src/shared/util.ts +++ b/src/shared/util.ts @@ -359,8 +359,8 @@ export function once any>(fn: T): T { // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#polyfill export function hasChanged(x: unknown, y: unknown): boolean { if (x === y) { - return x === 0 && 1 / x !== 1 / (y as number) + return x !== 0 || 1 / x === 1 / (y as number) } else { - return x === x && y === y + return x !== x && y !== y } }