webpipe-js 2.0.23 → 2.0.25

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 CHANGED
@@ -1062,6 +1062,10 @@ var Parser = class {
1062
1062
  if (bt !== null) return bt;
1063
1063
  const qt = this.tryParse(() => this.parseQuotedString());
1064
1064
  if (qt !== null) return qt;
1065
+ if (this.text.startsWith("null", this.pos)) {
1066
+ this.pos += 4;
1067
+ return "null";
1068
+ }
1065
1069
  if (this.text.startsWith("true", this.pos)) {
1066
1070
  this.pos += 4;
1067
1071
  return "true";
@@ -1073,6 +1077,12 @@ var Parser = class {
1073
1077
  const num = this.tryParse(() => {
1074
1078
  const digits = this.consumeWhile((c) => /[0-9]/.test(c));
1075
1079
  if (digits.length === 0) throw new Error("number");
1080
+ if (this.cur() === ".") {
1081
+ this.pos++;
1082
+ const decimals = this.consumeWhile((c) => /[0-9]/.test(c));
1083
+ if (decimals.length === 0) throw new Error("Expected digits after decimal point");
1084
+ return digits + "." + decimals;
1085
+ }
1076
1086
  return digits;
1077
1087
  });
1078
1088
  if (num !== null) return num;
@@ -1094,16 +1104,7 @@ var Parser = class {
1094
1104
  if (!m) break;
1095
1105
  mocks.push(m);
1096
1106
  }
1097
- this.expect("when");
1098
- this.skipInlineSpaces();
1099
- const when = this.parseWhen();
1100
- this.skipSpaces();
1101
1107
  const variables = [];
1102
- let input;
1103
- let body;
1104
- let headers;
1105
- let cookies;
1106
- let firstWithClause = true;
1107
1108
  while (true) {
1108
1109
  const letBinding = this.tryParse(() => {
1109
1110
  const binding = this.parseLetBinding();
@@ -1114,6 +1115,18 @@ var Parser = class {
1114
1115
  variables.push(letBinding);
1115
1116
  continue;
1116
1117
  }
1118
+ break;
1119
+ }
1120
+ this.expect("when");
1121
+ this.skipInlineSpaces();
1122
+ const when = this.parseWhen();
1123
+ this.skipSpaces();
1124
+ let input;
1125
+ let body;
1126
+ let headers;
1127
+ let cookies;
1128
+ let firstWithClause = true;
1129
+ while (true) {
1117
1130
  const parsed = this.tryParse(() => {
1118
1131
  if (firstWithClause) {
1119
1132
  this.expect("with");
package/dist/index.mjs CHANGED
@@ -1012,6 +1012,10 @@ var Parser = class {
1012
1012
  if (bt !== null) return bt;
1013
1013
  const qt = this.tryParse(() => this.parseQuotedString());
1014
1014
  if (qt !== null) return qt;
1015
+ if (this.text.startsWith("null", this.pos)) {
1016
+ this.pos += 4;
1017
+ return "null";
1018
+ }
1015
1019
  if (this.text.startsWith("true", this.pos)) {
1016
1020
  this.pos += 4;
1017
1021
  return "true";
@@ -1023,6 +1027,12 @@ var Parser = class {
1023
1027
  const num = this.tryParse(() => {
1024
1028
  const digits = this.consumeWhile((c) => /[0-9]/.test(c));
1025
1029
  if (digits.length === 0) throw new Error("number");
1030
+ if (this.cur() === ".") {
1031
+ this.pos++;
1032
+ const decimals = this.consumeWhile((c) => /[0-9]/.test(c));
1033
+ if (decimals.length === 0) throw new Error("Expected digits after decimal point");
1034
+ return digits + "." + decimals;
1035
+ }
1026
1036
  return digits;
1027
1037
  });
1028
1038
  if (num !== null) return num;
@@ -1044,16 +1054,7 @@ var Parser = class {
1044
1054
  if (!m) break;
1045
1055
  mocks.push(m);
1046
1056
  }
1047
- this.expect("when");
1048
- this.skipInlineSpaces();
1049
- const when = this.parseWhen();
1050
- this.skipSpaces();
1051
1057
  const variables = [];
1052
- let input;
1053
- let body;
1054
- let headers;
1055
- let cookies;
1056
- let firstWithClause = true;
1057
1058
  while (true) {
1058
1059
  const letBinding = this.tryParse(() => {
1059
1060
  const binding = this.parseLetBinding();
@@ -1064,6 +1065,18 @@ var Parser = class {
1064
1065
  variables.push(letBinding);
1065
1066
  continue;
1066
1067
  }
1068
+ break;
1069
+ }
1070
+ this.expect("when");
1071
+ this.skipInlineSpaces();
1072
+ const when = this.parseWhen();
1073
+ this.skipSpaces();
1074
+ let input;
1075
+ let body;
1076
+ let headers;
1077
+ let cookies;
1078
+ let firstWithClause = true;
1079
+ while (true) {
1067
1080
  const parsed = this.tryParse(() => {
1068
1081
  if (firstWithClause) {
1069
1082
  this.expect("with");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpipe-js",
3
- "version": "2.0.23",
3
+ "version": "2.0.25",
4
4
  "description": "Web Pipe parser",
5
5
  "license": "ISC",
6
6
  "author": "William Cotton",