MCPcopy Create free account
hub / github.com/pingdotgg/t3code / readNestedString

Function readNestedString

scripts/sync-reference-repos.ts:115–124  ·  view source on GitHub ↗
(input: unknown, keys: ReadonlyArray<string>)

Source from the content-addressed store, hash-verified

113 );
114
115function readNestedString(input: unknown, keys: ReadonlyArray<string>): string | undefined {
116 let value = input;
117 for (const key of keys) {
118 if (typeof value !== "object" || value === null || !(key in value)) {
119 return undefined;
120 }
121 value = (value as Record<string, unknown>)[key];
122 }
123 return typeof value === "string" && value.length > 0 ? value : undefined;
124}
125
126function decodeVersionSource(
127 repo: ReferenceRepo,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected