MCPcopy
hub / github.com/NervJS/nerv / objectIs

Function objectIs

packages/nerv-utils/src/is.ts:36–43  ·  view source on GitHub ↗
(x: any, y: any)

Source from the content-addressed store, hash-verified

34// Object.is polyfill
35// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/is
36export function objectIs (x: any, y: any) {
37 if (x === y) { // Steps 1-5, 7-10
38 // Steps 6.b-6.e: +0 != -0
39 return x !== 0 || 1 / x === 1 / y
40 }
41 // eslint-disable-next-line no-self-compare
42 return x !== x && y !== y
43}

Callers 3

areDepsChangedFunction · 0.90
ConsumerClass · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected