From 399935c32bcad98f060fdca3ba6b34c80a6fce22 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Thu, 18 Jul 2019 21:05:31 +0100 Subject: [PATCH] refactor(ivy): ngtsc - remove unnecessary type on helpers (#31544) The `ClassDeclaration` already contains the `{name: ts.Identifier}` type so there is no need to include it explicitly here. PR Close #31544 --- packages/compiler-cli/src/ngtsc/reflection/src/util.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/compiler-cli/src/ngtsc/reflection/src/util.ts b/packages/compiler-cli/src/ngtsc/reflection/src/util.ts index 069c709647..b75fee2632 100644 --- a/packages/compiler-cli/src/ngtsc/reflection/src/util.ts +++ b/packages/compiler-cli/src/ngtsc/reflection/src/util.ts @@ -7,21 +7,19 @@ */ import * as ts from 'typescript'; - import {ClassDeclaration} from './host'; - export function isNamedClassDeclaration(node: ts.Node): - node is ClassDeclaration&{name: ts.Identifier} { + node is ClassDeclaration { return ts.isClassDeclaration(node) && (node.name !== undefined); } export function isNamedFunctionDeclaration(node: ts.Node): - node is ClassDeclaration&{name: ts.Identifier} { + node is ClassDeclaration { return ts.isFunctionDeclaration(node) && (node.name !== undefined); } export function isNamedVariableDeclaration(node: ts.Node): - node is ClassDeclaration&{name: ts.Identifier} { + node is ClassDeclaration { return ts.isVariableDeclaration(node) && (node.name !== undefined); }