1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00

JS-6410: export import

This commit is contained in:
Andrew Simachev 2025-03-03 10:19:35 +01:00
parent 66a7a33704
commit edf33963e8
No known key found for this signature in database
GPG key ID: 1DFE44B21443F0EF
2 changed files with 28 additions and 1 deletions

View file

@ -259,6 +259,20 @@ class Api {
};
};
shortcutExport (win, dst, data) {
try {
fs.writeFileSync(path.join(dst, 'shortcut.json'), JSON.stringify(data, null, '\t'), 'utf8');
} catch (err) {};
};
shortcutImport (win, src) {
let data = {};
if (fs.existsSync(src)) {
try { data = JSON.parse(fs.readFileSync(src, 'utf8')); } catch (err) {};
};
return data;
};
};
module.exports = new Api();