MCPcopy Create free account
hub / github.com/immutable-js/immutable-js / getIENodeHash

Function getIENodeHash

src/Hash.ts:229–242  ·  view source on GitHub ↗
(node: unknown)

Source from the content-addressed store, hash-verified

227// and avoid memory leaks from the IE cloneNode bug.
228// TODO remove this method as only used if `canDefineProperty` is false
229function getIENodeHash(node: unknown): number | undefined {
230 // @ts-expect-error don't care
231 if (node && node.nodeType > 0) {
232 // @ts-expect-error don't care
233 switch (node.nodeType) {
234 case 1: // Element
235 // @ts-expect-error don't care
236 return node.uniqueID;
237 case 9: // Document
238 // @ts-expect-error don't care
239 return node.documentElement && node.documentElement.uniqueID;
240 }
241 }
242}
243
244function valueOf(obj: object): unknown {
245 return obj.valueOf !== defaultValueOf && typeof obj.valueOf === 'function'

Callers 1

hashJSObjFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected