Skip to content

Commit dd64199

Browse files
committed
Cleanup
1 parent 595d7c6 commit dd64199

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ function variableDefinitions(): ast.VariableDefinitionNode[] | undefined {
437437
_defaultValue = value(true);
438438
}
439439
ignored();
440-
const varDef: any = {
440+
const varDef: ast.VariableDefinitionNode = {
441441
kind: 'VariableDefinition' as Kind.VARIABLE_DEFINITION,
442442
variable: {
443443
kind: 'Variable' as Kind.VARIABLE,
@@ -463,7 +463,7 @@ function fragmentDefinition(description?: ast.StringValueNode): ast.FragmentDefi
463463
if (input.charCodeAt(idx++) !== 111 /*'o'*/ || input.charCodeAt(idx++) !== 110 /*'n'*/)
464464
throw error('FragmentDefinition');
465465
ignored();
466-
const fragDef: any = {
466+
const fragDef: ast.FragmentDefinitionNode = {
467467
kind: 'FragmentDefinition' as Kind.FRAGMENT_DEFINITION,
468468
name,
469469
typeCondition: {

src/printer.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ let LF = '\n';
5050
const nodes = {
5151
OperationDefinition(node: OperationDefinitionNode): string {
5252
let out: string = '';
53-
if ((node as any).description) {
54-
out += nodes.StringValue((node as any).description) + '\n';
53+
if (node.description) {
54+
out += nodes.StringValue(node.description) + '\n';
5555
}
5656
out += node.operation;
5757
if (node.name) out += ' ' + node.name.value;
@@ -66,8 +66,8 @@ const nodes = {
6666
},
6767
VariableDefinition(node: VariableDefinitionNode): string {
6868
let out = '';
69-
if ((node as any).description) {
70-
out += nodes.StringValue((node as any).description) + ' ';
69+
if (node.description) {
70+
out += nodes.StringValue(node.description) + ' ';
7171
}
7272
out += nodes.Variable!(node.variable) + ': ' + _print(node.type);
7373
if (node.defaultValue) out += ' = ' + _print(node.defaultValue);
@@ -160,8 +160,8 @@ const nodes = {
160160
},
161161
FragmentDefinition(node: FragmentDefinitionNode): string {
162162
let out = '';
163-
if ((node as any).description) {
164-
out += nodes.StringValue((node as any).description) + '\n';
163+
if (node.description) {
164+
out += nodes.StringValue(node.description) + '\n';
165165
}
166166
out += 'fragment ' + node.name.value;
167167
out += ' on ' + node.typeCondition.name.value;

0 commit comments

Comments
 (0)