MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / loadProjectVariableSchema

Function loadProjectVariableSchema

packages/cli/src/utils/variables.ts:174–186  ·  view source on GitHub ↗
(indexPath: string)

Source from the content-addressed store, hash-verified

172 * avoid the per-entry file read + DOMParser cost.
173 */
174export function loadProjectVariableSchema(indexPath: string): ProjectVariableSchema {
175 let html: string;
176 try {
177 html = readFileSync(indexPath, "utf8");
178 } catch {
179 return [];
180 }
181 // extractCompositionMetadata uses DOMParser, which Node doesn't ship.
182 // Same pattern as `compositions.ts` and other CLI commands that touch
183 // @hyperframes/core's HTML parsers.
184 ensureDOMParser();
185 return extractCompositionMetadata(html).variables;
186}
187
188/**
189 * Validate `values` against a pre-loaded schema. Empty schema means the

Callers 3

validateBatchVariablesFunction · 0.85
runRenderBatchFunction · 0.85

Calls 2

ensureDOMParserFunction · 0.85

Tested by

no test coverage detected