MCPcopy Create free account
hub / github.com/Effect-TS/effect / objectKind

Function objectKind

packages/effect/src/internal/equal.ts:65–84  ·  view source on GitHub ↗
(u: object)

Source from the content-addressed store, hash-verified

63
64/** @internal */
65export const objectKind = (u: object): number =>
66 Array.isArray(u) ?
67 5 :
68 ArrayBuffer.isView(u) ?
69 (u instanceof DataView ? 7 : 6) :
70 Object.getPrototypeOf(u) === Object.prototype ?
71 0 :
72 u instanceof Date ?
73 1 :
74 u instanceof RegExp ?
75 2 :
76 u instanceof Map ?
77 3 :
78 u instanceof Set ?
79 4 :
80 u instanceof ArrayBuffer ?
81 8 :
82 typeof SharedArrayBuffer !== "undefined" && u instanceof SharedArrayBuffer ?
83 9 :
84 0
85
86/**
87 * Returns `undefined` for detached buffers, which can no longer be read.

Callers 2

compareStructureFunction · 0.90
hashFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected