mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
28 lines
470 B
JavaScript
28 lines
470 B
JavaScript
const utils = require('./utils');
|
|
|
|
const localSourceIds = {};
|
|
|
|
function generateSourceId() {
|
|
const sourceId = utils.randomString(12);
|
|
|
|
localSourceIds[sourceId] = true;
|
|
|
|
return sourceId;
|
|
}
|
|
|
|
function isLocalSourceId(srcId) {
|
|
return !!localSourceIds[srcId];
|
|
}
|
|
|
|
const currentSourceId = generateSourceId();
|
|
|
|
function getCurrentSourceId() {
|
|
return currentSourceId;
|
|
}
|
|
|
|
module.exports = {
|
|
generateSourceId,
|
|
getCurrentSourceId,
|
|
isLocalSourceId
|
|
};
|