msw 0.36.5 → 0.38.1
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/README.md +3 -1
- package/lib/esm/fetch-deps.js +14 -12
- package/lib/esm/graphql-deps.js +1980 -1804
- package/lib/esm/index.js +60 -45
- package/lib/esm/mockServiceWorker.js +1 -1
- package/lib/iife/index.js +3 -3
- package/lib/iife/mockServiceWorker.js +1 -1
- package/lib/types/graphql.d.ts +6 -6
- package/lib/types/handlers/RequestHandler.d.ts +2 -2
- package/lib/types/response.d.ts +1 -1
- package/lib/types/setupWorker/glossary.d.ts +1 -1
- package/lib/types/utils/logging/prepareResponse.d.ts +2 -2
- package/lib/types/utils/request/onUnhandledRequest.d.ts +5 -1
- package/lib/types/utils/request/parseBody.d.ts +1 -1
- package/lib/umd/index.js +17091 -14331
- package/lib/umd/mockServiceWorker.js +1 -1
- package/native/lib/index.js +2026 -1833
- package/node/lib/index.js +2026 -1833
- package/package.json +23 -24
package/README.md
CHANGED
package/lib/esm/fetch-deps.js
CHANGED
|
@@ -656,7 +656,6 @@ var serialize_1 = serialize;
|
|
|
656
656
|
|
|
657
657
|
var decode = decodeURIComponent;
|
|
658
658
|
var encode = encodeURIComponent;
|
|
659
|
-
var pairSplitRegExp = /; */;
|
|
660
659
|
|
|
661
660
|
/**
|
|
662
661
|
* RegExp to match field-content in RFC 7230 sec 3.2
|
|
@@ -687,28 +686,29 @@ function parse(str, options) {
|
|
|
687
686
|
|
|
688
687
|
var obj = {};
|
|
689
688
|
var opt = options || {};
|
|
690
|
-
var pairs = str.split(
|
|
689
|
+
var pairs = str.split(';');
|
|
691
690
|
var dec = opt.decode || decode;
|
|
692
691
|
|
|
693
692
|
for (var i = 0; i < pairs.length; i++) {
|
|
694
693
|
var pair = pairs[i];
|
|
695
|
-
var
|
|
694
|
+
var index = pair.indexOf('=');
|
|
696
695
|
|
|
697
696
|
// skip things that don't look like key=value
|
|
698
|
-
if (
|
|
697
|
+
if (index < 0) {
|
|
699
698
|
continue;
|
|
700
699
|
}
|
|
701
700
|
|
|
702
|
-
var key = pair.
|
|
703
|
-
var val = pair.substr(++eq_idx, pair.length).trim();
|
|
704
|
-
|
|
705
|
-
// quoted values
|
|
706
|
-
if ('"' == val[0]) {
|
|
707
|
-
val = val.slice(1, -1);
|
|
708
|
-
}
|
|
701
|
+
var key = pair.substring(0, index).trim();
|
|
709
702
|
|
|
710
703
|
// only assign once
|
|
711
704
|
if (undefined == obj[key]) {
|
|
705
|
+
var val = pair.substring(index + 1, pair.length).trim();
|
|
706
|
+
|
|
707
|
+
// quoted values
|
|
708
|
+
if (val[0] === '"') {
|
|
709
|
+
val = val.slice(1, -1);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
712
|
obj[key] = tryDecode(val, dec);
|
|
713
713
|
}
|
|
714
714
|
}
|
|
@@ -974,7 +974,9 @@ const createFetchRequestParameters = (input) => {
|
|
|
974
974
|
if (['GET', 'HEAD'].includes(method)) {
|
|
975
975
|
return requestParameters;
|
|
976
976
|
}
|
|
977
|
-
if (typeof body === 'object' ||
|
|
977
|
+
if (typeof body === 'object' ||
|
|
978
|
+
typeof body === 'number' ||
|
|
979
|
+
typeof body === 'boolean') {
|
|
978
980
|
requestParameters.body = JSON.stringify(body);
|
|
979
981
|
}
|
|
980
982
|
else {
|