Skip to content

Commit e0fbf90

Browse files
Remove Flow workaround for const arguments (#1848)
1 parent ccbbb29 commit e0fbf90

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

src/type/directives.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,6 @@ export const specifiedDirectives: $ReadOnlyArray<*> = [
190190
export function isSpecifiedDirective(directive: mixed): boolean %checks {
191191
return (
192192
isDirective(directive) &&
193-
// Would prefer to use specifiedDirectives.some(), however %checks needs
194-
// a simple expression.
195-
(directive.name === GraphQLIncludeDirective.name ||
196-
directive.name === GraphQLSkipDirective.name ||
197-
directive.name === GraphQLDeprecatedDirective.name)
193+
specifiedDirectives.some(({ name }) => name === directive.name)
198194
);
199195
}

src/type/introspection.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -487,15 +487,6 @@ export const introspectionTypes: $ReadOnlyArray<*> = [
487487
export function isIntrospectionType(type: mixed): boolean %checks {
488488
return (
489489
isNamedType(type) &&
490-
// Would prefer to use introspectionTypes.some(), however %checks needs
491-
// a simple expression.
492-
(type.name === __Schema.name ||
493-
type.name === __Directive.name ||
494-
type.name === __DirectiveLocation.name ||
495-
type.name === __Type.name ||
496-
type.name === __Field.name ||
497-
type.name === __InputValue.name ||
498-
type.name === __EnumValue.name ||
499-
type.name === __TypeKind.name)
490+
introspectionTypes.some(({ name }) => type.name === name)
500491
);
501492
}

src/type/scalars.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,6 @@ export const specifiedScalarTypes: $ReadOnlyArray<*> = [
256256
export function isSpecifiedScalarType(type: mixed): boolean %checks {
257257
return (
258258
isScalarType(type) &&
259-
// Would prefer to use specifiedScalarTypes.some(), however %checks needs
260-
// a simple expression.
261-
(type.name === GraphQLString.name ||
262-
type.name === GraphQLInt.name ||
263-
type.name === GraphQLFloat.name ||
264-
type.name === GraphQLBoolean.name ||
265-
type.name === GraphQLID.name)
259+
specifiedScalarTypes.some(({ name }) => type.name === name)
266260
);
267261
}

0 commit comments

Comments
 (0)