From 627c9fe5004483538213fd832bfa58fb16b1856b Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 3 Jul 2018 11:05:47 -0700 Subject: [PATCH] Prepare tsutils for a future where the noop `unescapeIdentifier` function is removed (#66) --- util/util.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/util.ts b/util/util.ts index 621f431..4f55816 100644 --- a/util/util.ts +++ b/util/util.ts @@ -949,7 +949,8 @@ export function isReassignmentTarget(node: ts.Expression): boolean { * @param node The identifier to get the text of */ export function getIdentifierText(node: ts.Identifier) { - return ts.unescapeIdentifier(node.text); // wotan-disable-line no-unstable-api-use + // wotan-disable-next-line no-unstable-api-use, no-useless-predicate + return ts.unescapeIdentifier ? ts.unescapeIdentifier(node.text) : node.text; } export function canHaveJsDoc(node: ts.Node): node is ts.HasJSDoc {