@zimic/interceptor 1.1.3-canary.1 → 1.1.3-canary.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/http.mjs CHANGED
@@ -840,7 +840,7 @@ var LocalHttpRequestHandler = class {
840
840
  };
841
841
  var LocalHttpRequestHandler_default = LocalHttpRequestHandler;
842
842
 
843
- // ../zimic-utils/dist/chunk-TYSDS3LQ.mjs
843
+ // ../zimic-utils/dist/chunk-VPHA4ZCK.mjs
844
844
  function createPathCharactersToEscapeRegex() {
845
845
  return /([.(){}+$])/g;
846
846
  }
@@ -851,10 +851,10 @@ function preparePathForRegex(path) {
851
851
  return encodedPath.replace(/^\/+/g, "").replace(/\/+$/g, "").replace(createPathCharactersToEscapeRegex(), "\\$1");
852
852
  }
853
853
  function createPathParamRegex() {
854
- return /(?<escape>\\)?:(?<identifier>[$_\p{ID_Start}][$\p{ID_Continue}]+)/gu;
854
+ return /(?<escape>\\)?:(?<identifier>[$_\p{ID_Start}][$\p{ID_Continue}]+)(?!\\[*+?])/gu;
855
855
  }
856
856
  function createRepeatingPathParamRegex() {
857
- return /(?<escape>\\)?:(?<identifier>[$_\p{ID_Start}][$\p{ID_Continue}]+)\\+/gu;
857
+ return /(?<escape>\\)?:(?<identifier>[$_\p{ID_Start}][$\p{ID_Continue}]+)\\\+/gu;
858
858
  }
859
859
  function createOptionalPathParamRegex() {
860
860
  return /(?<leadingSlash>\/)?(?<escape>\\)?:(?<identifier>[$_\p{ID_Start}][$\p{ID_Continue}]+)\?(?<trailingSlash>\/)?/gu;
@@ -867,7 +867,7 @@ function createRegexFromPath(path) {
867
867
  createOptionalRepeatingPathParamRegex(),
868
868
  (_match, leadingSlash, escape, identifier, trailingSlash) => {
869
869
  if (escape) {
870
- return `:${identifier}`;
870
+ return `${leadingSlash ?? ""}:${identifier}\\*${trailingSlash ?? ""}`;
871
871
  }
872
872
  const hasSegmentBeforePrefix = leadingSlash === "/";
873
873
  const prefixExpression = hasSegmentBeforePrefix ? "/?" : leadingSlash;
@@ -884,12 +884,12 @@ function createRegexFromPath(path) {
884
884
  }
885
885
  }
886
886
  ).replace(createRepeatingPathParamRegex(), (_match, escape, identifier) => {
887
- return escape ? `:${identifier}` : `(?<${identifier}>.+)`;
887
+ return escape ? `:${identifier}\\+` : `(?<${identifier}>.+)`;
888
888
  }).replace(
889
889
  createOptionalPathParamRegex(),
890
890
  (_match, leadingSlash, escape, identifier, trailingSlash) => {
891
891
  if (escape) {
892
- return `:${identifier}`;
892
+ return `${leadingSlash ?? ""}:${identifier}\\?${trailingSlash ?? ""}`;
893
893
  }
894
894
  const hasSegmentBeforePrefix = leadingSlash === "/";
895
895
  const prefixExpression = hasSegmentBeforePrefix ? "/?" : leadingSlash;