MCPcopy
hub / github.com/Effect-TS/effect / is

Function is

packages/effect/src/ParseResult.ts:664–668  ·  view source on GitHub ↗
(schema: Schema.Schema<A, I, R>, options?: AST.ParseOptions)

Source from the content-addressed store, hash-verified

662 * @since 3.10.0
663 */
664export const is = <A, I, R>(schema: Schema.Schema<A, I, R>, options?: AST.ParseOptions) => {
665 const parser = goMemo(AST.typeAST(schema.ast), true)
666 return (u: unknown, overrideOptions?: AST.ParseOptions | number): u is A =>
667 Either.isRight(parser(u, { exact: true, ...mergeInternalOptions(options, overrideOptions) }) as any)
668}
669
670/**
671 * By default the option `exact` is set to `true`.

Callers 4

Pretty.tsFile · 0.70
decodeUnknownFunction · 0.70
Schema.tsFile · 0.70
getEquivalenceFunction · 0.70

Calls 3

goMemoFunction · 0.85
parserFunction · 0.85
mergeInternalOptionsFunction · 0.85

Tested by

no test coverage detected