8e51f31247dc212098d15393656e7dc0841becb0f4127412ac78b20b7c39c1555a5e3def555371f03654172c2988da4937a7f1e4e6f0bcf3fee5b0125573d7 651 B

123456789101112131415161718
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.stripTrailingSlashes = void 0;
  4. // warning: extremely hot code path.
  5. // This has been meticulously optimized for use
  6. // within npm install on large package trees.
  7. // Do not edit without careful benchmarking.
  8. const stripTrailingSlashes = (str) => {
  9. let i = str.length - 1;
  10. let slashesStart = -1;
  11. while (i > -1 && str.charAt(i) === '/') {
  12. slashesStart = i;
  13. i--;
  14. }
  15. return slashesStart === -1 ? str : str.slice(0, slashesStart);
  16. };
  17. exports.stripTrailingSlashes = stripTrailingSlashes;
  18. //# sourceMappingURL=strip-trailing-slashes.js.map