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

Function makeOption

packages/effect/src/SchemaParser.ts:75–79  ·  view source on GitHub ↗
(schema: S)

Source from the content-addressed store, hash-verified

73 * @since 4.0.0
74 */
75export function makeOption<S extends Schema.Constraint>(schema: S) {
76 const parser = makeEffect(schema)
77 return (input: S["~type.make.in"], options?: Schema.MakeOptions): Option.Option<S["Type"]> =>
78 exitToOption(Effect.runSyncExit(parser(input, options)))
79}
80
81/**
82 * Creates a synchronous maker for the schema's decoded type side.

Calls 3

exitToOptionFunction · 0.85
makeEffectFunction · 0.70
parserFunction · 0.70

Tested by

no test coverage detected