@sync-in/server
Version:
The secure, open-source platform for file storage, sharing, collaboration, and sync
30 lines (29 loc) • 1.06 kB
JavaScript
/*
* Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
* This file is part of Sync-in | The open source file sync and share solution
* See the LICENSE file for licensing details
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "WEBDAV_PATH_TO_SPACE_SEGMENTS", {
enumerable: true,
get: function() {
return WEBDAV_PATH_TO_SPACE_SEGMENTS;
}
});
const _routes = require("../../spaces/utils/routes");
const _routes1 = require("../constants/routes");
function WEBDAV_PATH_TO_SPACE_SEGMENTS(path) {
const urlSegments = (0, _routes.PATH_TO_SPACE_SEGMENTS)(path);
if (urlSegments[0] === _routes1.WEBDAV_BASE_PATH) {
urlSegments.shift();
}
const repository = urlSegments.shift();
if (!(repository in _routes1.WEBDAV_SPACES)) {
throw new Error(`Repository not found : ${repository}`);
}
urlSegments.unshift(..._routes1.WEBDAV_SPACES[repository].spaceRepository);
return urlSegments;
}
//# sourceMappingURL=routes.js.map