webpipe-js 2.0.1 → 2.0.3
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 -4
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +17 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -143,6 +143,7 @@ var Parser = class {
|
|
|
143
143
|
let graphqlSchema;
|
|
144
144
|
const queries = [];
|
|
145
145
|
const mutations = [];
|
|
146
|
+
let featureFlags;
|
|
146
147
|
while (!this.eof()) {
|
|
147
148
|
this.skipWhitespaceOnly();
|
|
148
149
|
if (this.eof()) break;
|
|
@@ -177,6 +178,11 @@ var Parser = class {
|
|
|
177
178
|
mutations.push(mutation);
|
|
178
179
|
continue;
|
|
179
180
|
}
|
|
181
|
+
const flags = this.tryParse(() => this.parseFeatureFlags());
|
|
182
|
+
if (flags) {
|
|
183
|
+
featureFlags = flags;
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
180
186
|
const namedPipe = this.tryParse(() => this.parseNamedPipeline());
|
|
181
187
|
if (namedPipe) {
|
|
182
188
|
namedPipe.lineNumber = this.getLineNumber(start);
|
|
@@ -216,7 +222,7 @@ var Parser = class {
|
|
|
216
222
|
const start = Math.max(0, idx);
|
|
217
223
|
this.report("Unclosed backtick-delimited string", start, start + 1, "warning");
|
|
218
224
|
}
|
|
219
|
-
return { configs, pipelines, variables, routes, describes, comments, graphqlSchema, queries, mutations };
|
|
225
|
+
return { configs, pipelines, variables, routes, describes, comments, graphqlSchema, queries, mutations, featureFlags };
|
|
220
226
|
}
|
|
221
227
|
eof() {
|
|
222
228
|
return this.pos >= this.len;
|
|
@@ -563,9 +569,7 @@ var Parser = class {
|
|
|
563
569
|
return { varType, name, value, inlineComment: inlineComment || void 0 };
|
|
564
570
|
}
|
|
565
571
|
parseGraphQLSchema() {
|
|
566
|
-
this.expect("
|
|
567
|
-
this.skipInlineSpaces();
|
|
568
|
-
this.expect("schema");
|
|
572
|
+
this.expect("graphqlSchema");
|
|
569
573
|
this.skipInlineSpaces();
|
|
570
574
|
this.expect("=");
|
|
571
575
|
const inlineComment = this.parseInlineComment();
|
|
@@ -598,6 +602,15 @@ var Parser = class {
|
|
|
598
602
|
this.skipWhitespaceOnly();
|
|
599
603
|
return { name, pipeline, inlineComment: inlineComment || void 0 };
|
|
600
604
|
}
|
|
605
|
+
parseFeatureFlags() {
|
|
606
|
+
this.expect("featureFlags");
|
|
607
|
+
this.skipInlineSpaces();
|
|
608
|
+
this.expect("=");
|
|
609
|
+
this.skipWhitespaceOnly();
|
|
610
|
+
const pipeline = this.parsePipeline();
|
|
611
|
+
this.skipWhitespaceOnly();
|
|
612
|
+
return pipeline;
|
|
613
|
+
}
|
|
601
614
|
parseRoute() {
|
|
602
615
|
const method = this.parseMethod();
|
|
603
616
|
this.skipInlineSpaces();
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -94,6 +94,7 @@ var Parser = class {
|
|
|
94
94
|
let graphqlSchema;
|
|
95
95
|
const queries = [];
|
|
96
96
|
const mutations = [];
|
|
97
|
+
let featureFlags;
|
|
97
98
|
while (!this.eof()) {
|
|
98
99
|
this.skipWhitespaceOnly();
|
|
99
100
|
if (this.eof()) break;
|
|
@@ -128,6 +129,11 @@ var Parser = class {
|
|
|
128
129
|
mutations.push(mutation);
|
|
129
130
|
continue;
|
|
130
131
|
}
|
|
132
|
+
const flags = this.tryParse(() => this.parseFeatureFlags());
|
|
133
|
+
if (flags) {
|
|
134
|
+
featureFlags = flags;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
131
137
|
const namedPipe = this.tryParse(() => this.parseNamedPipeline());
|
|
132
138
|
if (namedPipe) {
|
|
133
139
|
namedPipe.lineNumber = this.getLineNumber(start);
|
|
@@ -167,7 +173,7 @@ var Parser = class {
|
|
|
167
173
|
const start = Math.max(0, idx);
|
|
168
174
|
this.report("Unclosed backtick-delimited string", start, start + 1, "warning");
|
|
169
175
|
}
|
|
170
|
-
return { configs, pipelines, variables, routes, describes, comments, graphqlSchema, queries, mutations };
|
|
176
|
+
return { configs, pipelines, variables, routes, describes, comments, graphqlSchema, queries, mutations, featureFlags };
|
|
171
177
|
}
|
|
172
178
|
eof() {
|
|
173
179
|
return this.pos >= this.len;
|
|
@@ -514,9 +520,7 @@ var Parser = class {
|
|
|
514
520
|
return { varType, name, value, inlineComment: inlineComment || void 0 };
|
|
515
521
|
}
|
|
516
522
|
parseGraphQLSchema() {
|
|
517
|
-
this.expect("
|
|
518
|
-
this.skipInlineSpaces();
|
|
519
|
-
this.expect("schema");
|
|
523
|
+
this.expect("graphqlSchema");
|
|
520
524
|
this.skipInlineSpaces();
|
|
521
525
|
this.expect("=");
|
|
522
526
|
const inlineComment = this.parseInlineComment();
|
|
@@ -549,6 +553,15 @@ var Parser = class {
|
|
|
549
553
|
this.skipWhitespaceOnly();
|
|
550
554
|
return { name, pipeline, inlineComment: inlineComment || void 0 };
|
|
551
555
|
}
|
|
556
|
+
parseFeatureFlags() {
|
|
557
|
+
this.expect("featureFlags");
|
|
558
|
+
this.skipInlineSpaces();
|
|
559
|
+
this.expect("=");
|
|
560
|
+
this.skipWhitespaceOnly();
|
|
561
|
+
const pipeline = this.parsePipeline();
|
|
562
|
+
this.skipWhitespaceOnly();
|
|
563
|
+
return pipeline;
|
|
564
|
+
}
|
|
552
565
|
parseRoute() {
|
|
553
566
|
const method = this.parseMethod();
|
|
554
567
|
this.skipInlineSpaces();
|