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

Function configPathToString

packages/effect/src/internal/configProvider.ts:754–776  ·  view source on GitHub ↗
(path: ReadonlyArray<KeyComponent>)

Source from the content-addressed store, hash-verified

752}
753
754const configPathToString = (path: ReadonlyArray<KeyComponent>): ReadonlyArray<string> => {
755 const output: Array<string> = []
756 let i = 0
757 while (i < path.length) {
758 const component = path[i]
759 if (component._tag === "KeyName") {
760 if (i + 1 < path.length) {
761 const nextComponent = path[i + 1]
762 if (nextComponent._tag === "KeyIndex") {
763 output.push(`${component.name}[${nextComponent.index}]`)
764 i += 2
765 } else {
766 output.push(component.name)
767 i += 1
768 }
769 } else {
770 output.push(component.name)
771 i += 1
772 }
773 }
774 }
775 return output
776}
777
778const getIndexedEntries = (
779 config: JsonMap

Callers 1

fromJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected