Skip to content

Commit 1bbb7b9

Browse files
committed
Mark all eval methods as internal
1 parent 683177b commit 1bbb7b9

File tree

6 files changed

+28
-0
lines changed

6 files changed

+28
-0
lines changed

grafast/grafast/src/steps/__inputDynamicScalar.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,15 @@ export class __InputDynamicScalarStep<
129129
return converted;
130130
};
131131

132+
/** @internal */
132133
eval(): TLeaf {
133134
const variableValues = this.variableNames.map((variableName, i) =>
134135
this.getDep<__TrackedValueStep>(i).eval(),
135136
);
136137
return this.valueFromValues(variableValues);
137138
}
138139

140+
/** @internal */
139141
evalIs(expectedValue: undefined | null | 0): boolean {
140142
if (
141143
expectedValue === undefined ||

grafast/grafast/src/steps/__inputList.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export class __InputListStep<
9595
return itemPlan;
9696
}
9797

98+
/** @internal */
9899
eval(): any[] | null {
99100
if (this.inputValues?.kind === "NullValue") {
100101
return null;
@@ -113,6 +114,7 @@ export class __InputListStep<
113114
return list;
114115
}
115116

117+
/** @internal */
116118
evalIs(value: null | undefined | 0): boolean {
117119
if (value === undefined) {
118120
return this.inputValues === value;
@@ -125,6 +127,7 @@ export class __InputListStep<
125127
}
126128
}
127129

130+
/** @internal */
128131
evalLength(): number | null {
129132
if (this.inputValues === undefined) {
130133
return null;

grafast/grafast/src/steps/__inputObject.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export class __InputObjectStep<
128128
return step;
129129
}
130130

131+
/** @internal */
131132
eval(): any {
132133
if (this.inputValues?.kind === "NullValue") {
133134
return null;
@@ -140,6 +141,7 @@ export class __InputObjectStep<
140141
return resultValues;
141142
}
142143

144+
/** @internal */
143145
evalIs(value: null | undefined | 0): boolean {
144146
if (value === undefined) {
145147
return this.inputValues === value;
@@ -156,6 +158,7 @@ export class __InputObjectStep<
156158
}
157159
}
158160

161+
/** @internal */
159162
evalIsEmpty(): boolean {
160163
return (
161164
this.inputValues?.kind === "ObjectValue" &&
@@ -164,6 +167,7 @@ export class __InputObjectStep<
164167
}
165168

166169
// Written without consulting spec.
170+
/** @internal */
167171
evalHas(attrName: string): boolean {
168172
if (!this.inputValues) {
169173
return false;
@@ -177,6 +181,7 @@ export class __InputObjectStep<
177181
return !this.inputFields[attrName].step.evalIs(undefined);
178182
}
179183

184+
/** @internal */
180185
evalKeys(): ReadonlyArray<keyof TInputType & string> | null {
181186
if (this.inputValues === undefined) {
182187
return null;

grafast/grafast/src/steps/__inputStaticLeaf.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ export class __InputStaticLeafStep<TLeaf = any> extends UnbatchedStep<TLeaf> {
5555
return constant(this.coercedValue, false);
5656
}
5757

58+
/** @internal */
5859
eval(): TLeaf {
5960
return this.coercedValue;
6061
}
6162

63+
/** @internal */
6264
evalIs(expectedValue: unknown): boolean {
6365
return this.coercedValue === expectedValue;
6466
}

grafast/grafast/src/steps/__trackedValue.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@ export class __TrackedValueStep<
292292
* **WARNING**: avoid using this where possible, it causes OpPlans to split.
293293
*
294294
* **WARNING**: this is the most expensive eval, if you need to eval, prefer evalIs, evalHas, etc instead.
295+
*
296+
* @internal
295297
*/
296298
eval(): TData | undefined {
297299
const { path, value } = this;
@@ -311,6 +313,8 @@ export class __TrackedValueStep<
311313
* Should only be used on scalars.
312314
*
313315
* **WARNING**: avoid using this where possible, it causes OpPlans to split.
316+
*
317+
* @internal
314318
*/
315319
evalIs(expectedValue: unknown): boolean {
316320
const { value, path } = this;
@@ -324,6 +328,7 @@ export class __TrackedValueStep<
324328
return pass;
325329
}
326330

331+
/** @internal */
327332
evalIsEmpty() {
328333
const { value, path } = this;
329334
const isEmpty =
@@ -344,6 +349,8 @@ export class __TrackedValueStep<
344349
* check will always return the same (boolean) result.
345350
*
346351
* **WARNING**: avoid using this where possible, it causes OpPlans to split.
352+
*
353+
* @internal
347354
*/
348355
evalHas(key: string): boolean {
349356
const { value, path } = this;
@@ -372,6 +379,8 @@ export class __TrackedValueStep<
372379
* check will always return the same result.
373380
*
374381
* **WARNING**: avoid using this where possible, it causes OpPlans to split.
382+
*
383+
* @internal
375384
*/
376385
evalKeys(): ReadonlyArray<keyof TData & string> | null {
377386
const { value, path } = this;
@@ -417,6 +426,8 @@ export class __TrackedValueStep<
417426
* the same length.
418427
*
419428
* **WARNING**: avoid using this where possible, it causes OpPlans to split.
429+
*
430+
* @internal
420431
*/
421432
evalLength(): number | null {
422433
const { value, path } = this;

grafast/grafast/src/steps/constant.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,17 @@ export class ConstantStep<TData> extends UnbatchedStep<TData> {
7171
return arrayOfLength(count, this.data);
7272
}
7373

74+
/** @internal */
7475
eval() {
7576
return this.data;
7677
}
7778

79+
/** @internal */
7880
evalIs(value: any) {
7981
return this.data === value;
8082
}
8183

84+
/** @internal */
8285
evalIsEmpty() {
8386
return (
8487
typeof this.data === "object" &&
@@ -87,10 +90,12 @@ export class ConstantStep<TData> extends UnbatchedStep<TData> {
8790
);
8891
}
8992

93+
/** @internal */
9094
evalLength() {
9195
return Array.isArray(this.data) ? this.data.length : null;
9296
}
9397

98+
/** @internal */
9499
evalKeys(): ReadonlyArray<keyof TData & string> | null {
95100
if (this.data == null || typeof this.data !== "object") {
96101
return null;

0 commit comments

Comments
 (0)