Files
yaak-mountain-loop/src-tauri/plugins/insomnia-importer/importers/workspace.js
2023-11-05 13:33:23 -08:00

16 lines
484 B
JavaScript

/**
* Import an Insomnia workspace object.
* @param {Object} w - The workspace object to import.
*/
export function importWorkspace(w, variables) {
console.log('IMPORTING Workspace', w._id, w.name, JSON.stringify(w, null, 2));
return {
id: w._id,
createdAt: new Date(w.created ?? Date.now()).toISOString().replace('Z', ''),
updatedAt: new Date(w.updated ?? Date.now()).toISOString().replace('Z', ''),
model: 'workspace',
name: w.name,
variables,
};
}