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

Function getOption

packages/effect/src/ParseResult.ts:447–451  ·  view source on GitHub ↗
(ast: AST.AST, isDecoding: boolean, options?: AST.ParseOptions)

Source from the content-addressed store, hash-verified

445
446/** @internal */
447export const getOption = (ast: AST.AST, isDecoding: boolean, options?: AST.ParseOptions) => {
448 const parser = getEither(ast, isDecoding, options)
449 return (input: unknown, overrideOptions?: AST.ParseOptions): Option.Option<any> =>
450 Option.getRight(parser(input, overrideOptions))
451}
452
453const getEffect = <R>(ast: AST.AST, isDecoding: boolean, options?: AST.ParseOptions) => {
454 const parser = goMemo(ast, isDecoding)

Callers 5

decodeUnknownOptionFunction · 0.85
encodeUnknownOptionFunction · 0.85
validateOptionFunction · 0.85
encodeDefaultFunction · 0.85
encodeExamplesFunction · 0.85

Calls 2

getEitherFunction · 0.85
parserFunction · 0.85

Tested by

no test coverage detected