UNPKG

775 BJavaScriptView Raw
1"use strict";
2/* eslint-disable valid-jsdoc */
3Object.defineProperty(exports, "__esModule", { value: true });
4exports.removeLeadingSlashes = exports.removeTrailingSlashes = exports.removeSlashes = void 0;
5/**
6 * @hidden
7 */
8function removeSlashes(path) {
9 path = removeLeadingSlashes(path);
10 path = removeTrailingSlashes(path);
11 return path;
12}
13exports.removeSlashes = removeSlashes;
14/**
15 * @hidden
16 */
17function removeTrailingSlashes(path) {
18 return path.endsWith('/') ? path.slice(0, -1) : path;
19}
20exports.removeTrailingSlashes = removeTrailingSlashes;
21/**
22 * @hidden
23 */
24function removeLeadingSlashes(path) {
25 return path.startsWith('/') ? path.slice(1) : path;
26}
27exports.removeLeadingSlashes = removeLeadingSlashes;
28//# sourceMappingURL=remove-slashes.js.map
\No newline at end of file