webpipe-js 2.0.15 → 2.0.16
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/index.cjs +44 -36
- package/dist/index.mjs +44 -36
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -943,42 +943,50 @@ var Parser = class {
|
|
|
943
943
|
this.skipInlineSpaces();
|
|
944
944
|
const when = this.parseWhen();
|
|
945
945
|
this.skipSpaces();
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
const
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
946
|
+
let input;
|
|
947
|
+
let body;
|
|
948
|
+
let headers;
|
|
949
|
+
let cookies;
|
|
950
|
+
while (true) {
|
|
951
|
+
const parsed = this.tryParse(() => {
|
|
952
|
+
this.expect("with");
|
|
953
|
+
this.skipInlineSpaces();
|
|
954
|
+
if (this.text.startsWith("input", this.pos)) {
|
|
955
|
+
this.expect("input");
|
|
956
|
+
this.skipInlineSpaces();
|
|
957
|
+
const v = this.parseBacktickString();
|
|
958
|
+
this.skipSpaces();
|
|
959
|
+
return { type: "input", value: v };
|
|
960
|
+
} else if (this.text.startsWith("body", this.pos)) {
|
|
961
|
+
this.expect("body");
|
|
962
|
+
this.skipInlineSpaces();
|
|
963
|
+
const v = this.parseBacktickString();
|
|
964
|
+
this.skipSpaces();
|
|
965
|
+
return { type: "body", value: v };
|
|
966
|
+
} else if (this.text.startsWith("headers", this.pos)) {
|
|
967
|
+
this.expect("headers");
|
|
968
|
+
this.skipInlineSpaces();
|
|
969
|
+
const v = this.parseBacktickString();
|
|
970
|
+
this.skipSpaces();
|
|
971
|
+
return { type: "headers", value: v };
|
|
972
|
+
} else if (this.text.startsWith("cookies", this.pos)) {
|
|
973
|
+
this.expect("cookies");
|
|
974
|
+
this.skipInlineSpaces();
|
|
975
|
+
const v = this.parseBacktickString();
|
|
976
|
+
this.skipSpaces();
|
|
977
|
+
return { type: "cookies", value: v };
|
|
978
|
+
} else if (this.text.startsWith("mock", this.pos)) {
|
|
979
|
+
throw new Error("mock");
|
|
980
|
+
} else {
|
|
981
|
+
throw new Error("unknown with clause");
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
if (!parsed) break;
|
|
985
|
+
if (parsed.type === "input") input = parsed.value;
|
|
986
|
+
else if (parsed.type === "body") body = parsed.value;
|
|
987
|
+
else if (parsed.type === "headers") headers = parsed.value;
|
|
988
|
+
else if (parsed.type === "cookies") cookies = parsed.value;
|
|
989
|
+
}
|
|
982
990
|
const extraMocks = [];
|
|
983
991
|
while (true) {
|
|
984
992
|
const m = this.tryParse(() => this.parseAndMock());
|
package/dist/index.mjs
CHANGED
|
@@ -893,42 +893,50 @@ var Parser = class {
|
|
|
893
893
|
this.skipInlineSpaces();
|
|
894
894
|
const when = this.parseWhen();
|
|
895
895
|
this.skipSpaces();
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
896
|
+
let input;
|
|
897
|
+
let body;
|
|
898
|
+
let headers;
|
|
899
|
+
let cookies;
|
|
900
|
+
while (true) {
|
|
901
|
+
const parsed = this.tryParse(() => {
|
|
902
|
+
this.expect("with");
|
|
903
|
+
this.skipInlineSpaces();
|
|
904
|
+
if (this.text.startsWith("input", this.pos)) {
|
|
905
|
+
this.expect("input");
|
|
906
|
+
this.skipInlineSpaces();
|
|
907
|
+
const v = this.parseBacktickString();
|
|
908
|
+
this.skipSpaces();
|
|
909
|
+
return { type: "input", value: v };
|
|
910
|
+
} else if (this.text.startsWith("body", this.pos)) {
|
|
911
|
+
this.expect("body");
|
|
912
|
+
this.skipInlineSpaces();
|
|
913
|
+
const v = this.parseBacktickString();
|
|
914
|
+
this.skipSpaces();
|
|
915
|
+
return { type: "body", value: v };
|
|
916
|
+
} else if (this.text.startsWith("headers", this.pos)) {
|
|
917
|
+
this.expect("headers");
|
|
918
|
+
this.skipInlineSpaces();
|
|
919
|
+
const v = this.parseBacktickString();
|
|
920
|
+
this.skipSpaces();
|
|
921
|
+
return { type: "headers", value: v };
|
|
922
|
+
} else if (this.text.startsWith("cookies", this.pos)) {
|
|
923
|
+
this.expect("cookies");
|
|
924
|
+
this.skipInlineSpaces();
|
|
925
|
+
const v = this.parseBacktickString();
|
|
926
|
+
this.skipSpaces();
|
|
927
|
+
return { type: "cookies", value: v };
|
|
928
|
+
} else if (this.text.startsWith("mock", this.pos)) {
|
|
929
|
+
throw new Error("mock");
|
|
930
|
+
} else {
|
|
931
|
+
throw new Error("unknown with clause");
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
if (!parsed) break;
|
|
935
|
+
if (parsed.type === "input") input = parsed.value;
|
|
936
|
+
else if (parsed.type === "body") body = parsed.value;
|
|
937
|
+
else if (parsed.type === "headers") headers = parsed.value;
|
|
938
|
+
else if (parsed.type === "cookies") cookies = parsed.value;
|
|
939
|
+
}
|
|
932
940
|
const extraMocks = [];
|
|
933
941
|
while (true) {
|
|
934
942
|
const m = this.tryParse(() => this.parseAndMock());
|