| 419 | |
| 420 | /** @internal */ |
| 421 | export const mergeInternalOptions = ( |
| 422 | options: InternalOptions | undefined, |
| 423 | overrideOptions: InternalOptions | number | undefined |
| 424 | ): InternalOptions | undefined => { |
| 425 | if (overrideOptions === undefined || Predicate.isNumber(overrideOptions)) { |
| 426 | return options |
| 427 | } |
| 428 | if (options === undefined) { |
| 429 | return overrideOptions |
| 430 | } |
| 431 | return { ...options, ...overrideOptions } |
| 432 | } |
| 433 | |
| 434 | const getEither = (ast: AST.AST, isDecoding: boolean, options?: AST.ParseOptions) => { |
| 435 | const parser = goMemo(ast, isDecoding) |