From fdd94498cf35d1f1da5364b874ed58eef1ce1511 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Thu, 16 Dec 2021 16:17:28 +0100 Subject: [PATCH] refactor(material/schematics): clean up workaround for TS 4.5 Cleans up a temporary workaround that was used to land support for TS 4.5. --- .../migrations/hammer-gestures-v9/import-manager.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/material/schematics/ng-update/migrations/hammer-gestures-v9/import-manager.ts b/src/material/schematics/ng-update/migrations/hammer-gestures-v9/import-manager.ts index 338d8e0a872e..64e2449b1508 100644 --- a/src/material/schematics/ng-update/migrations/hammer-gestures-v9/import-manager.ts +++ b/src/material/schematics/ng-update/migrations/hammer-gestures-v9/import-manager.ts @@ -358,8 +358,7 @@ export class ImportManager { // update the named bindings to not re-print the whole import (which could // cause unnecessary formatting changes) if (hasFlag(importData, ImportState.ADDED)) { - // TODO(crisbeto): needs to be cast to any until g3 is updated to TS 4.5. - const updatedImport = (ts.updateImportDeclaration as any)( + const updatedImport = ts.updateImportDeclaration( importData.node, undefined, undefined, @@ -536,6 +535,6 @@ function createImportSpecifier( name: ts.Identifier, ): ts.ImportSpecifier { return PARSED_TS_VERSION > 4.4 - ? (ts.createImportSpecifier as any)(false, propertyName, name) + ? ts.createImportSpecifier(false, propertyName, name) : (ts.createImportSpecifier as any)(propertyName, name); }