UNPKG

smc-hub

Version:

CoCalc: Backend webserver component

22 lines 785 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.stripBasePath = void 0; var base_path_1 = __importDefault(require("smc-util-node/base-path")); /* Strip the base path from a url. The resulting url will start with a /. */ function stripBasePath(url) { if (base_path_1.default.length <= 1) { // base path is just "/" so do NOT remove anything. return url; } // base path is something like "/foo/bar", so remove it. // In particular, it does not end in a /. return url.slice(base_path_1.default.length); } exports.stripBasePath = stripBasePath; //# sourceMappingURL=util.js.map