webpipe-js 2.0.27 → 2.0.28
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 +14 -0
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +13 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -29,6 +29,7 @@ __export(index_exports, {
|
|
|
29
29
|
formatTags: () => formatTags,
|
|
30
30
|
formatWhen: () => formatWhen,
|
|
31
31
|
getPipelineRanges: () => getPipelineRanges,
|
|
32
|
+
getTestLetVariableRanges: () => getTestLetVariableRanges,
|
|
32
33
|
getVariableRanges: () => getVariableRanges,
|
|
33
34
|
parseProgram: () => parseProgram,
|
|
34
35
|
parseProgramWithDiagnostics: () => parseProgramWithDiagnostics,
|
|
@@ -55,6 +56,7 @@ var Parser = class {
|
|
|
55
56
|
this.diagnostics = [];
|
|
56
57
|
this.pipelineRanges = /* @__PURE__ */ new Map();
|
|
57
58
|
this.variableRanges = /* @__PURE__ */ new Map();
|
|
59
|
+
this.testLetVariableRanges = /* @__PURE__ */ new Map();
|
|
58
60
|
this.text = text;
|
|
59
61
|
this.len = text.length;
|
|
60
62
|
}
|
|
@@ -67,6 +69,9 @@ var Parser = class {
|
|
|
67
69
|
getVariableRanges() {
|
|
68
70
|
return new Map(this.variableRanges);
|
|
69
71
|
}
|
|
72
|
+
getTestLetVariableRanges() {
|
|
73
|
+
return new Map(this.testLetVariableRanges);
|
|
74
|
+
}
|
|
70
75
|
report(message, start, end, severity) {
|
|
71
76
|
this.diagnostics.push({ message, start, end, severity });
|
|
72
77
|
}
|
|
@@ -1053,7 +1058,10 @@ var Parser = class {
|
|
|
1053
1058
|
parseLetBinding() {
|
|
1054
1059
|
this.expect("let");
|
|
1055
1060
|
this.skipInlineSpaces();
|
|
1061
|
+
const nameStart = this.pos;
|
|
1056
1062
|
const name = this.parseIdentifier();
|
|
1063
|
+
const nameEnd = this.pos;
|
|
1064
|
+
this.testLetVariableRanges.set(name, { start: nameStart, end: nameEnd });
|
|
1057
1065
|
this.skipInlineSpaces();
|
|
1058
1066
|
this.expect("=");
|
|
1059
1067
|
this.skipInlineSpaces();
|
|
@@ -1269,6 +1277,11 @@ function getVariableRanges(text) {
|
|
|
1269
1277
|
parser.parseProgram();
|
|
1270
1278
|
return parser.getVariableRanges();
|
|
1271
1279
|
}
|
|
1280
|
+
function getTestLetVariableRanges(text) {
|
|
1281
|
+
const parser = new Parser(text);
|
|
1282
|
+
parser.parseProgram();
|
|
1283
|
+
return parser.getTestLetVariableRanges();
|
|
1284
|
+
}
|
|
1272
1285
|
var ParseFailure = class extends Error {
|
|
1273
1286
|
constructor(message, at) {
|
|
1274
1287
|
super(message);
|
|
@@ -1657,6 +1670,7 @@ function formatWhen(when) {
|
|
|
1657
1670
|
formatTags,
|
|
1658
1671
|
formatWhen,
|
|
1659
1672
|
getPipelineRanges,
|
|
1673
|
+
getTestLetVariableRanges,
|
|
1660
1674
|
getVariableRanges,
|
|
1661
1675
|
parseProgram,
|
|
1662
1676
|
parseProgramWithDiagnostics,
|
package/dist/index.d.cts
CHANGED
|
@@ -225,6 +225,10 @@ declare function getVariableRanges(text: string): Map<string, {
|
|
|
225
225
|
start: number;
|
|
226
226
|
end: number;
|
|
227
227
|
}>;
|
|
228
|
+
declare function getTestLetVariableRanges(text: string): Map<string, {
|
|
229
|
+
start: number;
|
|
230
|
+
end: number;
|
|
231
|
+
}>;
|
|
228
232
|
declare function printRoute(route: Route): string;
|
|
229
233
|
declare function printConfig(config: Config): string;
|
|
230
234
|
declare function printPipeline(pipeline: NamedPipeline): string;
|
|
@@ -247,4 +251,4 @@ declare function formatTagExpr(expr: TagExpr): string;
|
|
|
247
251
|
declare function formatPipelineRef(ref: PipelineRef): string[];
|
|
248
252
|
declare function formatWhen(when: When): string;
|
|
249
253
|
|
|
250
|
-
export { type Comment, type Condition, type Config, type ConfigProperty, type ConfigType, type ConfigValue, type Describe, type DiagnosticSeverity, type DispatchBranch, type DomAssertType, type GraphQLSchema, type It, type LetValueFormat, type Mock, type MutationResolver, type NamedPipeline, type ParseDiagnostic, type Pipeline, type PipelineRef, type PipelineStep, type Program, type QueryResolver, type ResultBranch, type ResultBranchType, type Route, type Tag, type TagExpr, type Variable, type When, formatConfigValue, formatPipelineRef, formatPipelineStep, formatStepConfig, formatTag, formatTagExpr, formatTags, formatWhen, getPipelineRanges, getVariableRanges, parseProgram, parseProgramWithDiagnostics, prettyPrint, printComment, printCondition, printConfig, printDescribe, printGraphQLSchema, printMock, printMutationResolver, printPipeline, printQueryResolver, printRoute, printTest, printVariable };
|
|
254
|
+
export { type Comment, type Condition, type Config, type ConfigProperty, type ConfigType, type ConfigValue, type Describe, type DiagnosticSeverity, type DispatchBranch, type DomAssertType, type GraphQLSchema, type It, type LetValueFormat, type Mock, type MutationResolver, type NamedPipeline, type ParseDiagnostic, type Pipeline, type PipelineRef, type PipelineStep, type Program, type QueryResolver, type ResultBranch, type ResultBranchType, type Route, type Tag, type TagExpr, type Variable, type When, formatConfigValue, formatPipelineRef, formatPipelineStep, formatStepConfig, formatTag, formatTagExpr, formatTags, formatWhen, getPipelineRanges, getTestLetVariableRanges, getVariableRanges, parseProgram, parseProgramWithDiagnostics, prettyPrint, printComment, printCondition, printConfig, printDescribe, printGraphQLSchema, printMock, printMutationResolver, printPipeline, printQueryResolver, printRoute, printTest, printVariable };
|
package/dist/index.d.ts
CHANGED
|
@@ -225,6 +225,10 @@ declare function getVariableRanges(text: string): Map<string, {
|
|
|
225
225
|
start: number;
|
|
226
226
|
end: number;
|
|
227
227
|
}>;
|
|
228
|
+
declare function getTestLetVariableRanges(text: string): Map<string, {
|
|
229
|
+
start: number;
|
|
230
|
+
end: number;
|
|
231
|
+
}>;
|
|
228
232
|
declare function printRoute(route: Route): string;
|
|
229
233
|
declare function printConfig(config: Config): string;
|
|
230
234
|
declare function printPipeline(pipeline: NamedPipeline): string;
|
|
@@ -247,4 +251,4 @@ declare function formatTagExpr(expr: TagExpr): string;
|
|
|
247
251
|
declare function formatPipelineRef(ref: PipelineRef): string[];
|
|
248
252
|
declare function formatWhen(when: When): string;
|
|
249
253
|
|
|
250
|
-
export { type Comment, type Condition, type Config, type ConfigProperty, type ConfigType, type ConfigValue, type Describe, type DiagnosticSeverity, type DispatchBranch, type DomAssertType, type GraphQLSchema, type It, type LetValueFormat, type Mock, type MutationResolver, type NamedPipeline, type ParseDiagnostic, type Pipeline, type PipelineRef, type PipelineStep, type Program, type QueryResolver, type ResultBranch, type ResultBranchType, type Route, type Tag, type TagExpr, type Variable, type When, formatConfigValue, formatPipelineRef, formatPipelineStep, formatStepConfig, formatTag, formatTagExpr, formatTags, formatWhen, getPipelineRanges, getVariableRanges, parseProgram, parseProgramWithDiagnostics, prettyPrint, printComment, printCondition, printConfig, printDescribe, printGraphQLSchema, printMock, printMutationResolver, printPipeline, printQueryResolver, printRoute, printTest, printVariable };
|
|
254
|
+
export { type Comment, type Condition, type Config, type ConfigProperty, type ConfigType, type ConfigValue, type Describe, type DiagnosticSeverity, type DispatchBranch, type DomAssertType, type GraphQLSchema, type It, type LetValueFormat, type Mock, type MutationResolver, type NamedPipeline, type ParseDiagnostic, type Pipeline, type PipelineRef, type PipelineStep, type Program, type QueryResolver, type ResultBranch, type ResultBranchType, type Route, type Tag, type TagExpr, type Variable, type When, formatConfigValue, formatPipelineRef, formatPipelineStep, formatStepConfig, formatTag, formatTagExpr, formatTags, formatWhen, getPipelineRanges, getTestLetVariableRanges, getVariableRanges, parseProgram, parseProgramWithDiagnostics, prettyPrint, printComment, printCondition, printConfig, printDescribe, printGraphQLSchema, printMock, printMutationResolver, printPipeline, printQueryResolver, printRoute, printTest, printVariable };
|
package/dist/index.mjs
CHANGED
|
@@ -5,6 +5,7 @@ var Parser = class {
|
|
|
5
5
|
this.diagnostics = [];
|
|
6
6
|
this.pipelineRanges = /* @__PURE__ */ new Map();
|
|
7
7
|
this.variableRanges = /* @__PURE__ */ new Map();
|
|
8
|
+
this.testLetVariableRanges = /* @__PURE__ */ new Map();
|
|
8
9
|
this.text = text;
|
|
9
10
|
this.len = text.length;
|
|
10
11
|
}
|
|
@@ -17,6 +18,9 @@ var Parser = class {
|
|
|
17
18
|
getVariableRanges() {
|
|
18
19
|
return new Map(this.variableRanges);
|
|
19
20
|
}
|
|
21
|
+
getTestLetVariableRanges() {
|
|
22
|
+
return new Map(this.testLetVariableRanges);
|
|
23
|
+
}
|
|
20
24
|
report(message, start, end, severity) {
|
|
21
25
|
this.diagnostics.push({ message, start, end, severity });
|
|
22
26
|
}
|
|
@@ -1003,7 +1007,10 @@ var Parser = class {
|
|
|
1003
1007
|
parseLetBinding() {
|
|
1004
1008
|
this.expect("let");
|
|
1005
1009
|
this.skipInlineSpaces();
|
|
1010
|
+
const nameStart = this.pos;
|
|
1006
1011
|
const name = this.parseIdentifier();
|
|
1012
|
+
const nameEnd = this.pos;
|
|
1013
|
+
this.testLetVariableRanges.set(name, { start: nameStart, end: nameEnd });
|
|
1007
1014
|
this.skipInlineSpaces();
|
|
1008
1015
|
this.expect("=");
|
|
1009
1016
|
this.skipInlineSpaces();
|
|
@@ -1219,6 +1226,11 @@ function getVariableRanges(text) {
|
|
|
1219
1226
|
parser.parseProgram();
|
|
1220
1227
|
return parser.getVariableRanges();
|
|
1221
1228
|
}
|
|
1229
|
+
function getTestLetVariableRanges(text) {
|
|
1230
|
+
const parser = new Parser(text);
|
|
1231
|
+
parser.parseProgram();
|
|
1232
|
+
return parser.getTestLetVariableRanges();
|
|
1233
|
+
}
|
|
1222
1234
|
var ParseFailure = class extends Error {
|
|
1223
1235
|
constructor(message, at) {
|
|
1224
1236
|
super(message);
|
|
@@ -1606,6 +1618,7 @@ export {
|
|
|
1606
1618
|
formatTags,
|
|
1607
1619
|
formatWhen,
|
|
1608
1620
|
getPipelineRanges,
|
|
1621
|
+
getTestLetVariableRanges,
|
|
1609
1622
|
getVariableRanges,
|
|
1610
1623
|
parseProgram,
|
|
1611
1624
|
parseProgramWithDiagnostics,
|