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

Function fromJson

packages/effect/src/internal/configProvider.ts:740–752  ·  view source on GitHub ↗
(json: unknown)

Source from the content-addressed store, hash-verified

738
739/** @internal */
740export const fromJson = (json: unknown): ConfigProvider.ConfigProvider => {
741 const hiddenDelimiter = "\ufeff"
742 const indexedEntries = Arr.map(
743 getIndexedEntries(json as JsonMap).filter(([path]) =>
744 path.every((component) => component._tag === "KeyIndex" || !component.name.includes(hiddenDelimiter))
745 ),
746 ([key, value]): [string, string] => [configPathToString(key).join(hiddenDelimiter), value]
747 )
748 return fromMap(new Map(indexedEntries), {
749 pathDelim: hiddenDelimiter,
750 seqDelim: hiddenDelimiter
751 })
752}
753
754const configPathToString = (path: ReadonlyArray<KeyComponent>): ReadonlyArray<string> => {
755 const output: Array<string> = []

Callers

nothing calls this directly

Calls 5

getIndexedEntriesFunction · 0.85
configPathToStringFunction · 0.85
fromMapFunction · 0.85
mapMethod · 0.65
joinMethod · 0.65

Tested by

no test coverage detected