MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / getPathValue

Function getPathValue

packages/core/src/theme/validate.ts:102–110  ·  view source on GitHub ↗
(root: unknown, path: string)

Source from the content-addressed store, hash-verified

100}
101
102function getPathValue(root: unknown, path: string): unknown {
103 const parts = path.split(".");
104 let cursor: unknown = root;
105 for (const part of parts) {
106 if (!isRecord(cursor) || !(part in cursor)) return undefined;
107 cursor = cursor[part];
108 }
109 return cursor;
110}
111
112function formatValue(value: unknown): string {
113 if (typeof value === "string") return JSON.stringify(value);

Callers 2

throwMissingPathsFunction · 0.70
validateThemeFunction · 0.70

Calls 1

isRecordFunction · 0.70

Tested by

no test coverage detected