From 6fdea76782b6d7026652ada273c936ab8e4a07e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 17 Sep 2021 11:28:25 -0400 Subject: [PATCH] refactor: avoid string comparison --- packages/babel-parser/src/plugins/typescript/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 1a59d527ae86..6d90951f0672 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -2364,7 +2364,7 @@ export default (superClass: Class): Class => // export default interface allowed in: // https://github.com/Microsoft/TypeScript/pull/16040 - if (this.state.value === "interface") { + if (this.match(tt._interface)) { const interfaceNode = this.startNode(); this.next(); const result = this.tsParseInterfaceDeclaration(interfaceNode);