MCPcopy Create free account
hub / github.com/FlashpointProject/launcher / parseExtension

Function parseExtension

src/back/extensions/ExtensionsScanner.ts:137–146  ·  view source on GitHub ↗

* Parses an extension * * @param extFilePath Path to the Extension Manifest (package.json) * @param type System or User extension * @returns Fully formed Extension

(extFilePath: string, type: ExtensionType)

Source from the content-addressed store, hash-verified

135 * @returns Fully formed Extension
136 */
137async function parseExtension(extFilePath: string, type: ExtensionType): Promise<IExtension> {
138 const data = await readJsonFile(extFilePath);
139 const manifest = await parseExtensionManifest(data);
140 return {
141 id: getExtensionID(manifest.author, manifest.name),
142 type: type,
143 manifest: manifest,
144 extensionPath: path.resolve(path.dirname(extFilePath))
145 };
146}
147
148/**
149 * Parses the manifest file

Callers 2

scanSystemExtensionsFunction · 0.85
scanExtensionsFunction · 0.85

Calls 3

readJsonFileFunction · 0.90
parseExtensionManifestFunction · 0.85
getExtensionIDFunction · 0.85

Tested by

no test coverage detected