@enonic/js-utils
Version:
Enonic XP JavaScript Utils
30 lines (28 loc) • 543 B
JavaScript
// constants.ts
var DOT_SIGN = ".";
// storage/indexing/uniqueId.ts
function uniqueId({
repoId,
branchId,
nodeId,
versionKey
}) {
if (!repoId) {
throw new TypeError("uniqueId: Missing required named parameter repoId!");
}
if (!nodeId) {
throw new TypeError("uniqueId: Missing required named parameter nodeId!");
}
const parts = [repoId];
if (branchId) {
parts.push(branchId);
}
parts.push(nodeId);
if (versionKey) {
parts.push(versionKey);
}
return parts.join(DOT_SIGN);
}
export {
uniqueId
};