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

Function asSync

packages/effect/src/SchemaParser.ts:1100–1104  ·  view source on GitHub ↗
(
  parser: (input: E, options?: SchemaAST.ParseOptions) => Effect.Effect<T, SchemaIssue.Issue>
)

Source from the content-addressed store, hash-verified

1098}
1099
1100function asSync<T, E>(
1101 parser: (input: E, options?: SchemaAST.ParseOptions) => Effect.Effect<T, SchemaIssue.Issue>
1102): (input: E, options?: SchemaAST.ParseOptions) => T {
1103 return (input, options) => runSync(parser(input, options), "Sync adapter can only throw schema issues")
1104}
1105
1106function runSync<T>(effect: Effect.Effect<T, SchemaIssue.Issue>, message: string): T {
1107 const exit = Effect.runSyncExit(effect)

Callers 3

decodeUnknownSyncFunction · 0.85
encodeUnknownSyncFunction · 0.85
makeDetailedSyncFunction · 0.85

Calls 2

runSyncFunction · 0.70
parserFunction · 0.70

Tested by

no test coverage detected