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

Function instanceOf

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

Source from the content-addressed store, hash-verified

6736 * @since 3.10.0
6737 */
6738export function instanceOf<C extends abstract new(...args: any) => any, Iso = InstanceType<C>>(
6739 constructor: C,
6740 annotations?: Annotations.Declaration<InstanceType<C>> | undefined
6741): instanceOf<InstanceType<C>, Iso> {
6742 return declare((u): u is InstanceType<C> => u instanceof constructor, annotations)
6743}
6744/**
6745 * Constructs an `SchemaAST.Link` that describes how a value of type `T` encodes to and decodes from a `To` schema.
6746 * Used when building low-level AST transformations that bridge two schema types.

Callers 2

ErrorInstanceFunction · 0.70
Schema.tsFile · 0.70

Calls 1

declareFunction · 0.70

Tested by

no test coverage detected