webpipe-js 2.0.1 → 2.0.2
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 +16 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +16 -1
- 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;
|
|
@@ -598,6 +604,15 @@ var Parser = class {
|
|
|
598
604
|
this.skipWhitespaceOnly();
|
|
599
605
|
return { name, pipeline, inlineComment: inlineComment || void 0 };
|
|
600
606
|
}
|
|
607
|
+
parseFeatureFlags() {
|
|
608
|
+
this.expect("featureFlags");
|
|
609
|
+
this.skipInlineSpaces();
|
|
610
|
+
this.expect("=");
|
|
611
|
+
this.skipWhitespaceOnly();
|
|
612
|
+
const pipeline = this.parsePipeline();
|
|
613
|
+
this.skipWhitespaceOnly();
|
|
614
|
+
return pipeline;
|
|
615
|
+
}
|
|
601
616
|
parseRoute() {
|
|
602
617
|
const method = this.parseMethod();
|
|
603
618
|
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;
|
|
@@ -549,6 +555,15 @@ var Parser = class {
|
|
|
549
555
|
this.skipWhitespaceOnly();
|
|
550
556
|
return { name, pipeline, inlineComment: inlineComment || void 0 };
|
|
551
557
|
}
|
|
558
|
+
parseFeatureFlags() {
|
|
559
|
+
this.expect("featureFlags");
|
|
560
|
+
this.skipInlineSpaces();
|
|
561
|
+
this.expect("=");
|
|
562
|
+
this.skipWhitespaceOnly();
|
|
563
|
+
const pipeline = this.parsePipeline();
|
|
564
|
+
this.skipWhitespaceOnly();
|
|
565
|
+
return pipeline;
|
|
566
|
+
}
|
|
552
567
|
parseRoute() {
|
|
553
568
|
const method = this.parseMethod();
|
|
554
569
|
this.skipInlineSpaces();
|