推进 INI 面板 launch manifest compatibility predicate
This commit is contained in:
@@ -77,12 +77,23 @@ export function createIniPanelLaunchApiSchema() {
|
||||
};
|
||||
}
|
||||
|
||||
export function isSupportedIniPanelLaunchApiManifest(manifest, schema = createIniPanelLaunchApiSchema()) {
|
||||
if (!manifest || typeof manifest !== "object") {
|
||||
return false;
|
||||
}
|
||||
if (manifest.apiName !== schema.apiName || manifest.manifestVersion !== schema.manifestVersion) {
|
||||
return false;
|
||||
}
|
||||
return schema.fields.every((fieldName) => Object.hasOwn(manifest, fieldName));
|
||||
}
|
||||
|
||||
export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntries()) {
|
||||
const schema = createIniPanelLaunchApiSchema();
|
||||
return {
|
||||
apiName: schema.apiName,
|
||||
manifestVersion: schema.manifestVersion,
|
||||
methods: [
|
||||
"isSupportedLaunchApiManifest",
|
||||
"getLaunchApiSchema",
|
||||
"getLaunchApiManifest",
|
||||
"getLauncherLinks",
|
||||
|
||||
Reference in New Issue
Block a user