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

Function loadCursor

packages/effect/src/Config.ts:663–670  ·  view source on GitHub ↗
(provider, path)

Source from the content-addressed store, hash-verified

661 provider: ConfigProvider.ConfigProvider,
662 path: Path
663) => Effect.Effect<ConfigCursor> = (provider, path) =>
664 provider.load(path).pipe(
665 // Source errors travel as defects so they bypass schema issue recovery; `schema` converts them back.
666 mapReasons<SourceError, never>((reason) =>
667 Cause.isFailReason(reason) ? Cause.makeDieReason(reason.error).annotate(Cause.reasonAnnotations(reason)) : reason
668 ),
669 Effect.mapEager((node) => ({ provider, path, node, toString: cursorToString }))
670 )
671
672const loadChildCursor = (cursor: ConfigCursor, segment: string | number): Effect.Effect<ConfigCursor> =>
673 loadCursor(cursor.provider, [...cursor.path, segment])

Callers 2

loadChildCursorFunction · 0.85
schemaFunction · 0.85

Calls 4

mapReasonsFunction · 0.85
pipeMethod · 0.65
loadMethod · 0.65
annotateMethod · 0.65

Tested by

no test coverage detected