msw 2.4.6 → 2.4.8
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/lib/browser/index.js +7 -7
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/index.mjs +7 -7
- package/lib/browser/index.mjs.map +1 -1
- package/lib/iife/index.js +31 -15
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/package.json +4 -4
package/lib/iife/index.js
CHANGED
|
@@ -14089,7 +14089,7 @@ ${operationTypes.join("\n")}
|
|
|
14089
14089
|
};
|
|
14090
14090
|
}
|
|
14091
14091
|
|
|
14092
|
-
// node_modules/.pnpm/path-to-regexp@6.
|
|
14092
|
+
// node_modules/.pnpm/path-to-regexp@6.3.0/node_modules/path-to-regexp/dist.es2015/index.js
|
|
14093
14093
|
function lexer(str) {
|
|
14094
14094
|
var tokens = [];
|
|
14095
14095
|
var i = 0;
|
|
@@ -14178,8 +14178,7 @@ ${operationTypes.join("\n")}
|
|
|
14178
14178
|
options = {};
|
|
14179
14179
|
}
|
|
14180
14180
|
var tokens = lexer(str);
|
|
14181
|
-
var _a2 = options.prefixes, prefixes = _a2 === void 0 ? "./" : _a2;
|
|
14182
|
-
var defaultPattern = "[^".concat(escapeString(options.delimiter || "/#?"), "]+?");
|
|
14181
|
+
var _a2 = options.prefixes, prefixes = _a2 === void 0 ? "./" : _a2, _b2 = options.delimiter, delimiter = _b2 === void 0 ? "/#?" : _b2;
|
|
14183
14182
|
var result = [];
|
|
14184
14183
|
var key = 0;
|
|
14185
14184
|
var i = 0;
|
|
@@ -14203,6 +14202,24 @@ ${operationTypes.join("\n")}
|
|
|
14203
14202
|
}
|
|
14204
14203
|
return result2;
|
|
14205
14204
|
};
|
|
14205
|
+
var isSafe = function(value2) {
|
|
14206
|
+
for (var _i = 0, delimiter_1 = delimiter; _i < delimiter_1.length; _i++) {
|
|
14207
|
+
var char2 = delimiter_1[_i];
|
|
14208
|
+
if (value2.indexOf(char2) > -1)
|
|
14209
|
+
return true;
|
|
14210
|
+
}
|
|
14211
|
+
return false;
|
|
14212
|
+
};
|
|
14213
|
+
var safePattern = function(prefix2) {
|
|
14214
|
+
var prev = result[result.length - 1];
|
|
14215
|
+
var prevText = prefix2 || (prev && typeof prev === "string" ? prev : "");
|
|
14216
|
+
if (prev && !prevText) {
|
|
14217
|
+
throw new TypeError('Must have text between two parameters, missing text after "'.concat(prev.name, '"'));
|
|
14218
|
+
}
|
|
14219
|
+
if (!prevText || isSafe(prevText))
|
|
14220
|
+
return "[^".concat(escapeString(delimiter), "]+?");
|
|
14221
|
+
return "(?:(?!".concat(escapeString(prevText), ")[^").concat(escapeString(delimiter), "])+?");
|
|
14222
|
+
};
|
|
14206
14223
|
while (i < tokens.length) {
|
|
14207
14224
|
var char = tryConsume("CHAR");
|
|
14208
14225
|
var name = tryConsume("NAME");
|
|
@@ -14221,7 +14238,7 @@ ${operationTypes.join("\n")}
|
|
|
14221
14238
|
name: name || key++,
|
|
14222
14239
|
prefix,
|
|
14223
14240
|
suffix: "",
|
|
14224
|
-
pattern: pattern ||
|
|
14241
|
+
pattern: pattern || safePattern(prefix),
|
|
14225
14242
|
modifier: tryConsume("MODIFIER") || ""
|
|
14226
14243
|
});
|
|
14227
14244
|
continue;
|
|
@@ -14244,7 +14261,7 @@ ${operationTypes.join("\n")}
|
|
|
14244
14261
|
mustConsume("CLOSE");
|
|
14245
14262
|
result.push({
|
|
14246
14263
|
name: name_1 || (pattern_1 ? key++ : ""),
|
|
14247
|
-
pattern: name_1 && !pattern_1 ?
|
|
14264
|
+
pattern: name_1 && !pattern_1 ? safePattern(prefix) : pattern_1,
|
|
14248
14265
|
prefix,
|
|
14249
14266
|
suffix,
|
|
14250
14267
|
modifier: tryConsume("MODIFIER") || ""
|
|
@@ -14354,10 +14371,9 @@ ${operationTypes.join("\n")}
|
|
|
14354
14371
|
}
|
|
14355
14372
|
} else {
|
|
14356
14373
|
if (token.modifier === "+" || token.modifier === "*") {
|
|
14357
|
-
|
|
14358
|
-
} else {
|
|
14359
|
-
route += "(".concat(token.pattern, ")").concat(token.modifier);
|
|
14374
|
+
throw new TypeError('Can not repeat "'.concat(token.name, '" without a prefix and suffix'));
|
|
14360
14375
|
}
|
|
14376
|
+
route += "(".concat(token.pattern, ")").concat(token.modifier);
|
|
14361
14377
|
}
|
|
14362
14378
|
} else {
|
|
14363
14379
|
route += "(?:".concat(prefix).concat(suffix, ")").concat(token.modifier);
|
|
@@ -14388,7 +14404,7 @@ ${operationTypes.join("\n")}
|
|
|
14388
14404
|
return stringToRegexp(path, keys, options);
|
|
14389
14405
|
}
|
|
14390
14406
|
|
|
14391
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.35.
|
|
14407
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.35.6/node_modules/@mswjs/interceptors/lib/browser/chunk-6HYIRFX2.mjs
|
|
14392
14408
|
var encoder = new TextEncoder();
|
|
14393
14409
|
function encodeBuffer(text) {
|
|
14394
14410
|
return encoder.encode(text);
|
|
@@ -14404,7 +14420,7 @@ ${operationTypes.join("\n")}
|
|
|
14404
14420
|
);
|
|
14405
14421
|
}
|
|
14406
14422
|
|
|
14407
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.35.
|
|
14423
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.35.6/node_modules/@mswjs/interceptors/lib/browser/chunk-XVPRNJO7.mjs
|
|
14408
14424
|
var IS_PATCHED_MODULE = Symbol("isPatchedModule");
|
|
14409
14425
|
function isPropertyAccessible(obj, key) {
|
|
14410
14426
|
try {
|
|
@@ -14824,7 +14840,7 @@ ${operationTypes.join("\n")}
|
|
|
14824
14840
|
return message3.toString();
|
|
14825
14841
|
}
|
|
14826
14842
|
|
|
14827
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.35.
|
|
14843
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.35.6/node_modules/@mswjs/interceptors/lib/browser/chunk-QED3Q6Z2.mjs
|
|
14828
14844
|
var INTERNAL_REQUEST_ID_HEADER_NAME = "x-interceptors-internal-request-id";
|
|
14829
14845
|
function getGlobalSymbol(symbol) {
|
|
14830
14846
|
return (
|
|
@@ -14972,7 +14988,7 @@ ${operationTypes.join("\n")}
|
|
|
14972
14988
|
return Math.random().toString(16).slice(2);
|
|
14973
14989
|
}
|
|
14974
14990
|
|
|
14975
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.35.
|
|
14991
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.35.6/node_modules/@mswjs/interceptors/lib/browser/index.mjs
|
|
14976
14992
|
var BatchInterceptor = class extends Interceptor {
|
|
14977
14993
|
constructor(options) {
|
|
14978
14994
|
BatchInterceptor.symbol = Symbol(options.name);
|
|
@@ -29113,7 +29129,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
29113
29129
|
}
|
|
29114
29130
|
};
|
|
29115
29131
|
|
|
29116
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.35.
|
|
29132
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.35.6/node_modules/@mswjs/interceptors/lib/browser/chunk-THPGBWJQ.mjs
|
|
29117
29133
|
var InterceptorError = class extends Error {
|
|
29118
29134
|
constructor(message3) {
|
|
29119
29135
|
super(message3);
|
|
@@ -29281,7 +29297,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
29281
29297
|
return false;
|
|
29282
29298
|
}
|
|
29283
29299
|
|
|
29284
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.35.
|
|
29300
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.35.6/node_modules/@mswjs/interceptors/lib/browser/chunk-G5SOR3ND.mjs
|
|
29285
29301
|
function canParseUrl(url) {
|
|
29286
29302
|
try {
|
|
29287
29303
|
new URL(url);
|
|
@@ -29478,7 +29494,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
29478
29494
|
var FetchInterceptor = _FetchInterceptor;
|
|
29479
29495
|
FetchInterceptor.symbol = Symbol("fetch");
|
|
29480
29496
|
|
|
29481
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.35.
|
|
29497
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.35.6/node_modules/@mswjs/interceptors/lib/browser/chunk-SUQ32ZQK.mjs
|
|
29482
29498
|
function concatArrayBuffer(left, right) {
|
|
29483
29499
|
const result = new Uint8Array(left.byteLength + right.byteLength);
|
|
29484
29500
|
result.set(left, 0);
|