MCPcopy Create free account
hub / github.com/alibaba/lowcode-engine / loadSchemaFile

Function loadSchemaFile

modules/code-generator/src/cli/run.ts:134–147  ·  view source on GitHub ↗
(schemaFile: string)

Source from the content-addressed store, hash-verified

132}
133
134async function loadSchemaFile(schemaFile: string): Promise<IPublicTypeProjectSchema> {
135 if (!schemaFile) {
136 throw new Error('invalid schema file name');
137 }
138
139 const schemaFileContent = await fs.readFile(schemaFile, 'utf8');
140
141 if (/\.json5/.test(schemaFile)) {
142 return JSON5.parse(schemaFileContent);
143 }
144
145 // 默认用 JSONC 的格式解析(兼容 JSON)
146 return jsonc.parse(schemaFileContent);
147}

Callers 1

runFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…