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

Function instanceOf

packages/effect/src/Schema.ts:6496–6501  ·  view source on GitHub ↗
(
  constructor: C,
  annotations?: Annotations.Declaration<InstanceType<C>> | undefined
)

Source from the content-addressed store, hash-verified

6494 * @since 3.10.0
6495 */
6496export function instanceOf<C extends abstract new(...args: any) => any, Iso = InstanceType<C>>(
6497 constructor: C,
6498 annotations?: Annotations.Declaration<InstanceType<C>> | undefined
6499): instanceOf<InstanceType<C>, Iso> {
6500 return declare((u): u is InstanceType<C> => u instanceof constructor, annotations)
6501}
6502
6503/**
6504 * Constructs an `SchemaAST.Link` that describes how a value of type `T` encodes to and decodes from a `To` schema.

Callers 2

ErrorInstanceFunction · 0.70
Schema.tsFile · 0.70

Calls 1

declareFunction · 0.70

Tested by

no test coverage detected