msw 1.3.3 → 1.3.5
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/{SetupServerApi-1855d9c6.d.ts → SetupServerApi-cbd087af.d.ts} +1 -1
- package/lib/{glossary-de6278a9.d.ts → glossary-2792c6da.d.ts} +1 -1
- package/lib/iife/index.js +24 -8
- package/lib/iife/index.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/lib/native/index.d.ts +2 -2
- package/lib/node/index.d.ts +3 -3
- package/lib/node/index.js.map +1 -1
- package/lib/node/index.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IsomorphicResponse, BatchInterceptor, Interceptor, HttpRequestEventMap } from '@mswjs/interceptors';
|
|
2
|
-
import { L as LifeCycleEventsMap, S as SetupApi, K as SetupServer, c as RequestHandler, o as SharedOptions } from './glossary-
|
|
2
|
+
import { L as LifeCycleEventsMap, S as SetupApi, K as SetupServer, c as RequestHandler, o as SharedOptions } from './glossary-2792c6da.js';
|
|
3
3
|
|
|
4
4
|
type ServerLifecycleEventsMap = LifeCycleEventsMap<IsomorphicResponse>;
|
|
5
5
|
declare class SetupServerApi extends SetupApi<ServerLifecycleEventsMap> implements SetupServer {
|
|
@@ -74,7 +74,7 @@ declare class MockedRequest<RequestBody extends DefaultBodyType = DefaultBodyTyp
|
|
|
74
74
|
* Bypass the intercepted request.
|
|
75
75
|
* This will make a call to the actual endpoint requested.
|
|
76
76
|
*/
|
|
77
|
-
passthrough(): MockedResponse<
|
|
77
|
+
passthrough<BodyType extends DefaultBodyType = null>(): MockedResponse<BodyType>;
|
|
78
78
|
private getCookies;
|
|
79
79
|
}
|
|
80
80
|
|
package/lib/iife/index.js
CHANGED
|
@@ -12662,7 +12662,7 @@ spurious results.`);
|
|
|
12662
12662
|
};
|
|
12663
12663
|
}
|
|
12664
12664
|
|
|
12665
|
-
// node_modules/.pnpm/path-to-regexp@6.
|
|
12665
|
+
// node_modules/.pnpm/path-to-regexp@6.3.0/node_modules/path-to-regexp/dist.es2015/index.js
|
|
12666
12666
|
function lexer(str) {
|
|
12667
12667
|
var tokens = [];
|
|
12668
12668
|
var i = 0;
|
|
@@ -12745,8 +12745,7 @@ spurious results.`);
|
|
|
12745
12745
|
options = {};
|
|
12746
12746
|
}
|
|
12747
12747
|
var tokens = lexer(str);
|
|
12748
|
-
var _a2 = options.prefixes, prefixes = _a2 === void 0 ? "./" : _a2;
|
|
12749
|
-
var defaultPattern = "[^".concat(escapeString(options.delimiter || "/#?"), "]+?");
|
|
12748
|
+
var _a2 = options.prefixes, prefixes = _a2 === void 0 ? "./" : _a2, _b2 = options.delimiter, delimiter = _b2 === void 0 ? "/#?" : _b2;
|
|
12750
12749
|
var result = [];
|
|
12751
12750
|
var key = 0;
|
|
12752
12751
|
var i = 0;
|
|
@@ -12770,6 +12769,24 @@ spurious results.`);
|
|
|
12770
12769
|
}
|
|
12771
12770
|
return result2;
|
|
12772
12771
|
};
|
|
12772
|
+
var isSafe = function(value2) {
|
|
12773
|
+
for (var _i = 0, delimiter_1 = delimiter; _i < delimiter_1.length; _i++) {
|
|
12774
|
+
var char2 = delimiter_1[_i];
|
|
12775
|
+
if (value2.indexOf(char2) > -1)
|
|
12776
|
+
return true;
|
|
12777
|
+
}
|
|
12778
|
+
return false;
|
|
12779
|
+
};
|
|
12780
|
+
var safePattern = function(prefix2) {
|
|
12781
|
+
var prev = result[result.length - 1];
|
|
12782
|
+
var prevText = prefix2 || (prev && typeof prev === "string" ? prev : "");
|
|
12783
|
+
if (prev && !prevText) {
|
|
12784
|
+
throw new TypeError('Must have text between two parameters, missing text after "'.concat(prev.name, '"'));
|
|
12785
|
+
}
|
|
12786
|
+
if (!prevText || isSafe(prevText))
|
|
12787
|
+
return "[^".concat(escapeString(delimiter), "]+?");
|
|
12788
|
+
return "(?:(?!".concat(escapeString(prevText), ")[^").concat(escapeString(delimiter), "])+?");
|
|
12789
|
+
};
|
|
12773
12790
|
while (i < tokens.length) {
|
|
12774
12791
|
var char = tryConsume("CHAR");
|
|
12775
12792
|
var name = tryConsume("NAME");
|
|
@@ -12788,7 +12805,7 @@ spurious results.`);
|
|
|
12788
12805
|
name: name || key++,
|
|
12789
12806
|
prefix,
|
|
12790
12807
|
suffix: "",
|
|
12791
|
-
pattern: pattern ||
|
|
12808
|
+
pattern: pattern || safePattern(prefix),
|
|
12792
12809
|
modifier: tryConsume("MODIFIER") || ""
|
|
12793
12810
|
});
|
|
12794
12811
|
continue;
|
|
@@ -12811,7 +12828,7 @@ spurious results.`);
|
|
|
12811
12828
|
mustConsume("CLOSE");
|
|
12812
12829
|
result.push({
|
|
12813
12830
|
name: name_1 || (pattern_1 ? key++ : ""),
|
|
12814
|
-
pattern: name_1 && !pattern_1 ?
|
|
12831
|
+
pattern: name_1 && !pattern_1 ? safePattern(prefix) : pattern_1,
|
|
12815
12832
|
prefix,
|
|
12816
12833
|
suffix,
|
|
12817
12834
|
modifier: tryConsume("MODIFIER") || ""
|
|
@@ -12920,10 +12937,9 @@ spurious results.`);
|
|
|
12920
12937
|
}
|
|
12921
12938
|
} else {
|
|
12922
12939
|
if (token.modifier === "+" || token.modifier === "*") {
|
|
12923
|
-
|
|
12924
|
-
} else {
|
|
12925
|
-
route += "(".concat(token.pattern, ")").concat(token.modifier);
|
|
12940
|
+
throw new TypeError('Can not repeat "'.concat(token.name, '" without a prefix and suffix'));
|
|
12926
12941
|
}
|
|
12942
|
+
route += "(".concat(token.pattern, ")").concat(token.modifier);
|
|
12927
12943
|
}
|
|
12928
12944
|
} else {
|
|
12929
12945
|
route += "(?:".concat(prefix).concat(suffix, ")").concat(token.modifier);
|