add-path-suffix.js 442 B

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