add-path-prefix.js 442 B

123456789101112131415
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.addPathPrefix = addPathPrefix;
  6. var _parsePath = require("./parse-path");
  7. function addPathPrefix(path, prefix) {
  8. if (!path.startsWith('/') || !prefix) {
  9. return path;
  10. }
  11. const { pathname , query , hash } = (0, _parsePath).parsePath(path);
  12. return `${prefix}${pathname}${query}${hash}`;
  13. }
  14. //# sourceMappingURL=add-path-prefix.js.map