webpipe-js 2.0.53 → 2.0.57
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 +5 -19
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.mjs +5 -19
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -127,27 +127,21 @@ var Parser = class {
|
|
|
127
127
|
const originalPos = this.pos;
|
|
128
128
|
this.pos++;
|
|
129
129
|
const restOfLine = this.consumeWhile((ch) => ch !== "\n");
|
|
130
|
-
const end = this.pos;
|
|
131
130
|
return {
|
|
132
131
|
type: "standalone",
|
|
133
132
|
text: restOfLine,
|
|
134
133
|
style: "#",
|
|
135
|
-
lineNumber: this.getLineNumber(start)
|
|
136
|
-
start,
|
|
137
|
-
end
|
|
134
|
+
lineNumber: this.getLineNumber(start)
|
|
138
135
|
};
|
|
139
136
|
}
|
|
140
137
|
if (this.text.startsWith("//", this.pos)) {
|
|
141
138
|
this.pos += 2;
|
|
142
139
|
const text = this.consumeWhile((ch) => ch !== "\n");
|
|
143
|
-
const end = this.pos;
|
|
144
140
|
return {
|
|
145
141
|
type: "standalone",
|
|
146
142
|
text,
|
|
147
143
|
style: "//",
|
|
148
|
-
lineNumber: this.getLineNumber(start)
|
|
149
|
-
start,
|
|
150
|
-
end
|
|
144
|
+
lineNumber: this.getLineNumber(start)
|
|
151
145
|
};
|
|
152
146
|
}
|
|
153
147
|
return null;
|
|
@@ -927,7 +921,6 @@ var Parser = class {
|
|
|
927
921
|
const steps = [];
|
|
928
922
|
const comments = [];
|
|
929
923
|
while (true) {
|
|
930
|
-
const save = this.pos;
|
|
931
924
|
this.skipWhitespaceOnly();
|
|
932
925
|
const comment = this.tryParse(() => this.parseStandaloneComment());
|
|
933
926
|
if (comment) {
|
|
@@ -936,7 +929,6 @@ var Parser = class {
|
|
|
936
929
|
continue;
|
|
937
930
|
}
|
|
938
931
|
if (!this.text.startsWith("|>", this.pos)) {
|
|
939
|
-
this.pos = save;
|
|
940
932
|
break;
|
|
941
933
|
}
|
|
942
934
|
const step = this.parsePipelineStep();
|
|
@@ -1068,7 +1060,7 @@ var Parser = class {
|
|
|
1068
1060
|
this.skipInlineSpaces();
|
|
1069
1061
|
const path = this.consumeWhile((c) => c !== " " && c !== "\n" && c !== "#");
|
|
1070
1062
|
const inlineComment = this.parseInlineComment();
|
|
1071
|
-
this.
|
|
1063
|
+
this.skipWhitespaceOnly();
|
|
1072
1064
|
const pipeline = this.parsePipelineRef();
|
|
1073
1065
|
const end = this.pos;
|
|
1074
1066
|
this.skipWhitespaceOnly();
|
|
@@ -1273,7 +1265,6 @@ var Parser = class {
|
|
|
1273
1265
|
return { conditionType: ct, field, headerName: headerName ?? void 0, jqExpr: jqExpr ?? void 0, comparison, value, start, end };
|
|
1274
1266
|
}
|
|
1275
1267
|
parseMockHead(prefixWord) {
|
|
1276
|
-
this.skipSpaces();
|
|
1277
1268
|
const start = this.pos;
|
|
1278
1269
|
this.expect(prefixWord);
|
|
1279
1270
|
this.skipInlineSpaces();
|
|
@@ -1293,7 +1284,6 @@ var Parser = class {
|
|
|
1293
1284
|
this.expect("returning");
|
|
1294
1285
|
this.skipInlineSpaces();
|
|
1295
1286
|
const returnValue = this.parseBacktickString();
|
|
1296
|
-
this.skipSpaces();
|
|
1297
1287
|
const end = this.pos;
|
|
1298
1288
|
return { target, targetStart, returnValue, lineNumber: this.getLineNumber(start), start, end };
|
|
1299
1289
|
}
|
|
@@ -1623,9 +1613,7 @@ function printPipeline(pipeline) {
|
|
|
1623
1613
|
items.push({ type: "step", item: step, position: step.start });
|
|
1624
1614
|
});
|
|
1625
1615
|
pipeline.pipeline.comments.forEach((comment) => {
|
|
1626
|
-
|
|
1627
|
-
items.push({ type: "comment", item: comment, position: comment.start });
|
|
1628
|
-
}
|
|
1616
|
+
items.push({ type: "comment", item: comment, position: comment.lineNumber || 0 });
|
|
1629
1617
|
});
|
|
1630
1618
|
items.sort((a, b) => a.position - b.position);
|
|
1631
1619
|
items.forEach((entry) => {
|
|
@@ -2037,9 +2025,7 @@ function formatPipelineRef(ref) {
|
|
|
2037
2025
|
items.push({ type: "step", item: step, position: step.start });
|
|
2038
2026
|
});
|
|
2039
2027
|
ref.pipeline.comments.forEach((comment) => {
|
|
2040
|
-
|
|
2041
|
-
items.push({ type: "comment", item: comment, position: comment.start });
|
|
2042
|
-
}
|
|
2028
|
+
items.push({ type: "comment", item: comment, position: comment.lineNumber || 0 });
|
|
2043
2029
|
});
|
|
2044
2030
|
items.sort((a, b) => a.position - b.position);
|
|
2045
2031
|
items.forEach((entry) => {
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -74,27 +74,21 @@ var Parser = class {
|
|
|
74
74
|
const originalPos = this.pos;
|
|
75
75
|
this.pos++;
|
|
76
76
|
const restOfLine = this.consumeWhile((ch) => ch !== "\n");
|
|
77
|
-
const end = this.pos;
|
|
78
77
|
return {
|
|
79
78
|
type: "standalone",
|
|
80
79
|
text: restOfLine,
|
|
81
80
|
style: "#",
|
|
82
|
-
lineNumber: this.getLineNumber(start)
|
|
83
|
-
start,
|
|
84
|
-
end
|
|
81
|
+
lineNumber: this.getLineNumber(start)
|
|
85
82
|
};
|
|
86
83
|
}
|
|
87
84
|
if (this.text.startsWith("//", this.pos)) {
|
|
88
85
|
this.pos += 2;
|
|
89
86
|
const text = this.consumeWhile((ch) => ch !== "\n");
|
|
90
|
-
const end = this.pos;
|
|
91
87
|
return {
|
|
92
88
|
type: "standalone",
|
|
93
89
|
text,
|
|
94
90
|
style: "//",
|
|
95
|
-
lineNumber: this.getLineNumber(start)
|
|
96
|
-
start,
|
|
97
|
-
end
|
|
91
|
+
lineNumber: this.getLineNumber(start)
|
|
98
92
|
};
|
|
99
93
|
}
|
|
100
94
|
return null;
|
|
@@ -874,7 +868,6 @@ var Parser = class {
|
|
|
874
868
|
const steps = [];
|
|
875
869
|
const comments = [];
|
|
876
870
|
while (true) {
|
|
877
|
-
const save = this.pos;
|
|
878
871
|
this.skipWhitespaceOnly();
|
|
879
872
|
const comment = this.tryParse(() => this.parseStandaloneComment());
|
|
880
873
|
if (comment) {
|
|
@@ -883,7 +876,6 @@ var Parser = class {
|
|
|
883
876
|
continue;
|
|
884
877
|
}
|
|
885
878
|
if (!this.text.startsWith("|>", this.pos)) {
|
|
886
|
-
this.pos = save;
|
|
887
879
|
break;
|
|
888
880
|
}
|
|
889
881
|
const step = this.parsePipelineStep();
|
|
@@ -1015,7 +1007,7 @@ var Parser = class {
|
|
|
1015
1007
|
this.skipInlineSpaces();
|
|
1016
1008
|
const path = this.consumeWhile((c) => c !== " " && c !== "\n" && c !== "#");
|
|
1017
1009
|
const inlineComment = this.parseInlineComment();
|
|
1018
|
-
this.
|
|
1010
|
+
this.skipWhitespaceOnly();
|
|
1019
1011
|
const pipeline = this.parsePipelineRef();
|
|
1020
1012
|
const end = this.pos;
|
|
1021
1013
|
this.skipWhitespaceOnly();
|
|
@@ -1220,7 +1212,6 @@ var Parser = class {
|
|
|
1220
1212
|
return { conditionType: ct, field, headerName: headerName ?? void 0, jqExpr: jqExpr ?? void 0, comparison, value, start, end };
|
|
1221
1213
|
}
|
|
1222
1214
|
parseMockHead(prefixWord) {
|
|
1223
|
-
this.skipSpaces();
|
|
1224
1215
|
const start = this.pos;
|
|
1225
1216
|
this.expect(prefixWord);
|
|
1226
1217
|
this.skipInlineSpaces();
|
|
@@ -1240,7 +1231,6 @@ var Parser = class {
|
|
|
1240
1231
|
this.expect("returning");
|
|
1241
1232
|
this.skipInlineSpaces();
|
|
1242
1233
|
const returnValue = this.parseBacktickString();
|
|
1243
|
-
this.skipSpaces();
|
|
1244
1234
|
const end = this.pos;
|
|
1245
1235
|
return { target, targetStart, returnValue, lineNumber: this.getLineNumber(start), start, end };
|
|
1246
1236
|
}
|
|
@@ -1570,9 +1560,7 @@ function printPipeline(pipeline) {
|
|
|
1570
1560
|
items.push({ type: "step", item: step, position: step.start });
|
|
1571
1561
|
});
|
|
1572
1562
|
pipeline.pipeline.comments.forEach((comment) => {
|
|
1573
|
-
|
|
1574
|
-
items.push({ type: "comment", item: comment, position: comment.start });
|
|
1575
|
-
}
|
|
1563
|
+
items.push({ type: "comment", item: comment, position: comment.lineNumber || 0 });
|
|
1576
1564
|
});
|
|
1577
1565
|
items.sort((a, b) => a.position - b.position);
|
|
1578
1566
|
items.forEach((entry) => {
|
|
@@ -1984,9 +1972,7 @@ function formatPipelineRef(ref) {
|
|
|
1984
1972
|
items.push({ type: "step", item: step, position: step.start });
|
|
1985
1973
|
});
|
|
1986
1974
|
ref.pipeline.comments.forEach((comment) => {
|
|
1987
|
-
|
|
1988
|
-
items.push({ type: "comment", item: comment, position: comment.start });
|
|
1989
|
-
}
|
|
1975
|
+
items.push({ type: "comment", item: comment, position: comment.lineNumber || 0 });
|
|
1990
1976
|
});
|
|
1991
1977
|
items.sort((a, b) => a.position - b.position);
|
|
1992
1978
|
items.forEach((entry) => {
|