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
This commit is contained in:
Pete Bacon Darwin 2019-07-18 21:05:31 +01:00 committed by Misko Hevery
parent 97ab52c618
commit 399935c32b
1 changed files with 3 additions and 5 deletions

View File

@ -7,21 +7,19 @@
*/ */
import * as ts from 'typescript'; import * as ts from 'typescript';
import {ClassDeclaration} from './host'; import {ClassDeclaration} from './host';
export function isNamedClassDeclaration(node: ts.Node): export function isNamedClassDeclaration(node: ts.Node):
node is ClassDeclaration<ts.ClassDeclaration>&{name: ts.Identifier} { node is ClassDeclaration<ts.ClassDeclaration> {
return ts.isClassDeclaration(node) && (node.name !== undefined); return ts.isClassDeclaration(node) && (node.name !== undefined);
} }
export function isNamedFunctionDeclaration(node: ts.Node): export function isNamedFunctionDeclaration(node: ts.Node):
node is ClassDeclaration<ts.FunctionDeclaration>&{name: ts.Identifier} { node is ClassDeclaration<ts.FunctionDeclaration> {
return ts.isFunctionDeclaration(node) && (node.name !== undefined); return ts.isFunctionDeclaration(node) && (node.name !== undefined);
} }
export function isNamedVariableDeclaration(node: ts.Node): export function isNamedVariableDeclaration(node: ts.Node):
node is ClassDeclaration<ts.VariableDeclaration>&{name: ts.Identifier} { node is ClassDeclaration<ts.VariableDeclaration> {
return ts.isVariableDeclaration(node) && (node.name !== undefined); return ts.isVariableDeclaration(node) && (node.name !== undefined);
} }