( self: ConfigProvider.ConfigProvider.Flat, that: LazyArg<ConfigProvider.ConfigProvider.Flat> )
| 497 | >(2, (self, that) => fromFlat(orElseFlat(self.flattened, () => that().flattened))) |
| 498 | |
| 499 | const orElseFlat = ( |
| 500 | self: ConfigProvider.ConfigProvider.Flat, |
| 501 | that: LazyArg<ConfigProvider.ConfigProvider.Flat> |
| 502 | ): ConfigProvider.ConfigProvider.Flat => |
| 503 | makeFlat({ |
| 504 | load: (path, config, split) => |
| 505 | pipe( |
| 506 | pathPatch.patch(path, self.patch), |
| 507 | core.flatMap((patch) => self.load(patch, config, split)), |
| 508 | core.catchAll((error1) => |
| 509 | pipe( |
| 510 | core.sync(that), |
| 511 | core.flatMap((that) => |
| 512 | pipe( |
| 513 | pathPatch.patch(path, that.patch), |
| 514 | core.flatMap((patch) => that.load(patch, config, split)), |
| 515 | core.catchAll((error2) => core.fail(configError.Or(error1, error2))) |
| 516 | ) |
| 517 | ) |
| 518 | ) |
| 519 | ) |
| 520 | ), |
| 521 | enumerateChildren: (path) => |
| 522 | pipe( |
| 523 | pathPatch.patch(path, self.patch), |
| 524 | core.flatMap((patch) => self.enumerateChildren(patch)), |
| 525 | core.either, |
| 526 | core.flatMap((left) => |
| 527 | pipe( |
| 528 | core.sync(that), |
| 529 | core.flatMap((that) => |
| 530 | pipe( |
| 531 | pathPatch.patch(path, that.patch), |
| 532 | core.flatMap((patch) => that.enumerateChildren(patch)), |
| 533 | core.either, |
| 534 | core.flatMap((right) => { |
| 535 | if (Either.isLeft(left) && Either.isLeft(right)) { |
| 536 | return core.fail(configError.And(left.left, right.left)) |
| 537 | } |
| 538 | if (Either.isLeft(left) && Either.isRight(right)) { |
| 539 | return core.succeed(right.right) |
| 540 | } |
| 541 | if (Either.isRight(left) && Either.isLeft(right)) { |
| 542 | return core.succeed(left.right) |
| 543 | } |
| 544 | if (Either.isRight(left) && Either.isRight(right)) { |
| 545 | return core.succeed(pipe(left.right, HashSet.union(right.right))) |
| 546 | } |
| 547 | throw new Error( |
| 548 | "BUG: ConfigProvider.orElseFlat - please report an issue at https://github.com/Effect-TS/effect/issues" |
| 549 | ) |
| 550 | }) |
| 551 | ) |
| 552 | ) |
| 553 | ) |
| 554 | ) |
| 555 | ), |
| 556 | patch: pathPatch.empty |
no test coverage detected