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