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

Function _issue

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

Source from the content-addressed store, hash-verified

187
188/** @internal */
189export function _issue<T>(ast: SchemaAST.AST) {
190 const parser = run<T, never>(ast)
191 return (input: unknown, options: SchemaAST.ParseOptions): SchemaIssue.Issue | undefined => {
192 const exit = Effect.runSyncExit(parser(input, options))
193 if (Exit.isSuccess(exit)) {
194 return undefined
195 }
196 return InternalSchemaCause.getSchemaIssueOrThrow(exit.cause, "Issue adapter can only return schema issues")
197 }
198}
199
200/**
201 * Asserts that an input satisfies the schema's decoded type side.

Callers

nothing calls this directly

Calls 2

runFunction · 0.70
parserFunction · 0.70

Tested by

no test coverage detected