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

Function _issue

packages/effect/src/SchemaParser.ts:166–175  ·  view source on GitHub ↗
(ast: SchemaAST.AST)

Source from the content-addressed store, hash-verified

164
165/** @internal */
166export function _issue<T>(ast: SchemaAST.AST) {
167 const parser = run<T, never>(ast)
168 return (input: unknown, options: SchemaAST.ParseOptions): SchemaIssue.Issue | undefined => {
169 const exit = Effect.runSyncExit(parser(input, options))
170 if (Exit.isSuccess(exit)) {
171 return undefined
172 }
173 return InternalSchemaCause.getSchemaIssueOrThrow(exit.cause, "Issue adapter can only return schema issues")
174 }
175}
176
177/**
178 * Asserts that an input satisfies the schema's decoded type side.

Callers

nothing calls this directly

Calls 1

runFunction · 0.70

Tested by

no test coverage detected