Skip to content

Commit 79da01a

Browse files
committed
convert $Values (flow) to keyof (TS)
1 parent 8c59969 commit 79da01a

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/language/directiveLocation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ export const DirectiveLocation = Object.freeze({
2828
/**
2929
* The enum type representing the directive location values.
3030
*/
31-
export type DirectiveLocationEnum = $Values<typeof DirectiveLocation>;
31+
export type DirectiveLocationEnum = typeof DirectiveLocation[keyof typeof DirectiveLocation];

src/language/kinds.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ export const Kind = Object.freeze({
7171
/**
7272
* The enum type representing the possible kind values of AST nodes.
7373
*/
74-
export type KindEnum = $Values<typeof Kind>;
74+
export type KindEnum = typeof Kind[keyof typeof Kind];

src/language/tokenKind.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ export const TokenKind = Object.freeze({
3030
/**
3131
* The enum type representing the token kinds values.
3232
*/
33-
export type TokenKindEnum = $Values<typeof TokenKind>;
33+
export type TokenKindEnum = typeof TokenKind[keyof typeof TokenKind];

src/language/visitor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { isNode } from './ast';
99
* relevant functions to be called during the visitor's traversal.
1010
*/
1111
export type ASTVisitor = Visitor<ASTKindToNode>;
12-
export type Visitor<KindToNode, Nodes = $Values<KindToNode>> =
12+
export type Visitor<KindToNode, Nodes = KindToNode[keyof KindToNode]> =
1313
| EnterLeave<
1414
| VisitFn<Nodes>
1515
| ShapeMap<KindToNode, <Node>(Node) => VisitFn<Nodes, Node>>

0 commit comments

Comments
 (0)