Postman importer semi-complete

This commit is contained in:
Gregory Schier
2023-11-10 09:08:20 -08:00
parent d5295efd82
commit feb542fd2b
21 changed files with 6057 additions and 13 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 parsed.resources; // Should already be in the correct format
}
export function isJSObject(obj) {
return Object.prototype.toString.call(obj) === '[object Object]';
}