Move plugin stuff around

This commit is contained in:
Gregory Schier
2024-01-15 14:33:51 -08:00
parent f55c8aba56
commit d23de93917
25 changed files with 3417 additions and 8 deletions

View File

@@ -0,0 +1,20 @@
export function pluginHookImport(contents) {
let parsed;
try {
parsed = JSON.parse(contents);
} catch (err) {
return undefined;
}
if (!isJSObject(parsed)) {
return undefined;
}
if (parsed.yaakSchema !== 1) return undefined;
return { resources: parsed.resources }; // Should already be in the correct format
}
export function isJSObject(obj) {
return Object.prototype.toString.call(obj) === '[object Object]';
}