mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-22 17:39:12 +01:00
gRPC in import/export
This commit is contained in:
@@ -10,9 +10,21 @@ export function pluginHookImport(contents) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (parsed.yaakSchema !== 1) return undefined;
|
||||
if (!('yaakSchema' in parsed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
return { resources: parsed.resources }; // Should already be in the correct format
|
||||
// Migrate v1 to v2 -- changes requests to httpRequests
|
||||
if (parsed.yaakSchema === 1) {
|
||||
parsed.resources.httpRequests = parsed.resources.requests;
|
||||
parsed.yaakSchema = 2;
|
||||
}
|
||||
|
||||
if (parsed.yaakSchema === 2) {
|
||||
return { resources: parsed.resources }; // Should already be in the correct format
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function isJSObject(obj) {
|
||||
|
||||
Reference in New Issue
Block a user