webpipe-js 2.0.24 → 2.0.26
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 +17 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +17 -1
- package/package.json +1 -1
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;
|
|
@@ -1197,10 +1207,16 @@ var Parser = class {
|
|
|
1197
1207
|
this.expect('"');
|
|
1198
1208
|
const inlineComment = this.parseInlineComment();
|
|
1199
1209
|
this.skipSpaces();
|
|
1210
|
+
const variables = [];
|
|
1200
1211
|
const mocks = [];
|
|
1201
1212
|
const tests = [];
|
|
1202
1213
|
while (true) {
|
|
1203
1214
|
this.skipSpaces();
|
|
1215
|
+
const letBinding = this.tryParse(() => this.parseLetBinding());
|
|
1216
|
+
if (letBinding) {
|
|
1217
|
+
variables.push(letBinding);
|
|
1218
|
+
continue;
|
|
1219
|
+
}
|
|
1204
1220
|
const withMock = this.tryParse(() => this.parseMock());
|
|
1205
1221
|
if (withMock) {
|
|
1206
1222
|
mocks.push(withMock);
|
|
@@ -1218,7 +1234,7 @@ var Parser = class {
|
|
|
1218
1234
|
}
|
|
1219
1235
|
break;
|
|
1220
1236
|
}
|
|
1221
|
-
return { name, mocks, tests, inlineComment: inlineComment || void 0 };
|
|
1237
|
+
return { name, variables, mocks, tests, inlineComment: inlineComment || void 0 };
|
|
1222
1238
|
}
|
|
1223
1239
|
};
|
|
1224
1240
|
function parseProgram(text) {
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
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;
|
|
@@ -1147,10 +1157,16 @@ var Parser = class {
|
|
|
1147
1157
|
this.expect('"');
|
|
1148
1158
|
const inlineComment = this.parseInlineComment();
|
|
1149
1159
|
this.skipSpaces();
|
|
1160
|
+
const variables = [];
|
|
1150
1161
|
const mocks = [];
|
|
1151
1162
|
const tests = [];
|
|
1152
1163
|
while (true) {
|
|
1153
1164
|
this.skipSpaces();
|
|
1165
|
+
const letBinding = this.tryParse(() => this.parseLetBinding());
|
|
1166
|
+
if (letBinding) {
|
|
1167
|
+
variables.push(letBinding);
|
|
1168
|
+
continue;
|
|
1169
|
+
}
|
|
1154
1170
|
const withMock = this.tryParse(() => this.parseMock());
|
|
1155
1171
|
if (withMock) {
|
|
1156
1172
|
mocks.push(withMock);
|
|
@@ -1168,7 +1184,7 @@ var Parser = class {
|
|
|
1168
1184
|
}
|
|
1169
1185
|
break;
|
|
1170
1186
|
}
|
|
1171
|
-
return { name, mocks, tests, inlineComment: inlineComment || void 0 };
|
|
1187
|
+
return { name, variables, mocks, tests, inlineComment: inlineComment || void 0 };
|
|
1172
1188
|
}
|
|
1173
1189
|
};
|
|
1174
1190
|
function parseProgram(text) {
|