refactor(ivy): remove superfluous isComponentDef function (#28880)

PR Close #28880
This commit is contained in:
Ben Lesh 2019-02-20 18:06:05 -08:00
parent 7c20bf8845
commit 230a941c3f
1 changed files with 1 additions and 12 deletions

View File

@ -7,24 +7,13 @@
*/
import {Type} from '../../interface/type';
import {Component} from '../../metadata/directives';
import {fillProperties} from '../../util/property';
import {EMPTY_ARRAY, EMPTY_OBJ} from '../empty';
import {ComponentDef, DirectiveDef, DirectiveDefFeature, RenderFlags} from '../interfaces/definition';
import {isComponentDef} from '../util';
import {NgOnChangesFeature} from './ng_onchanges_feature';
/**
* Determines if a definition is a {@link ComponentDef} or a {@link DirectiveDef}
* @param definition The definition to examine
*/
function isComponentDef<T>(definition: ComponentDef<T>| DirectiveDef<T>):
definition is ComponentDef<T> {
const def = definition as ComponentDef<T>;
return typeof def.template === 'function';
}
function getSuperType(type: Type<any>): Type<any>&
{ngComponentDef?: ComponentDef<any>, ngDirectiveDef?: DirectiveDef<any>} {
return Object.getPrototypeOf(type.prototype).constructor;