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

Function hasSlot

packages/effect/src/ui/Query.ts:2331–2338  ·  view source on GitHub ↗
(intrinsic: Intrinsic, u: object)

Source from the content-addressed store, hash-verified

2329type Intrinsic = (this: unknown, ...args: Array<any>) => any
2330const getter = (proto: object, key: PropertyKey): Intrinsic => Object.getOwnPropertyDescriptor(proto, key)!.get!
2331const hasSlot = (intrinsic: Intrinsic, u: object): boolean => {
2332 try {
2333 intrinsic.call(u)
2334 return true
2335 } catch {
2336 return false
2337 }
2338}
2339const typedArrayProto: object = Object.getPrototypeOf(Uint8Array.prototype)
2340const typedArrayTag = getter(typedArrayProto, Symbol.toStringTag)
2341const typedArrayBuffer = getter(typedArrayProto, "buffer")

Callers 1

materializeFunction · 0.85

Calls 1

callMethod · 0.45

Tested by

no test coverage detected