From 973d15c262f113c4cb88762971920053fdbd31ff Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Wed, 25 Sep 2024 20:34:22 -0700 Subject: [PATCH] Remove optional operator --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 5cab2fc..f37b674 100644 --- a/src/index.ts +++ b/src/index.ts @@ -628,6 +628,6 @@ function isNameSafe(name: string) { } function isNextNameSafe(token: Token | undefined) { - if (token?.type !== "text") return true; + if (!token || token.type !== "text") return true; return !ID_CONTINUE.test(token.value[0]); }