33 lines
672 B
JavaScript
33 lines
672 B
JavaScript
const STORAGE_NAMESPACE = 'Omni-SMS_Extension';
|
|
|
|
function normalizeSegment(value) {
|
|
return String(value || '').trim().replace(/^\/+|\/+$/g, '');
|
|
}
|
|
|
|
function joinStoragePath(...segments) {
|
|
return [STORAGE_NAMESPACE, ...segments]
|
|
.map(normalizeSegment)
|
|
.filter(Boolean)
|
|
.join('/');
|
|
}
|
|
|
|
function businessRoot(companyId, businessId) {
|
|
return joinStoragePath(companyId, businessId);
|
|
}
|
|
|
|
function indexPath(companyId) {
|
|
return joinStoragePath(companyId);
|
|
}
|
|
|
|
function onboardingJobsRoot(companyId) {
|
|
return joinStoragePath(companyId, 'jobs');
|
|
}
|
|
|
|
module.exports = {
|
|
STORAGE_NAMESPACE,
|
|
joinStoragePath,
|
|
businessRoot,
|
|
indexPath,
|
|
onboardingJobsRoot,
|
|
};
|