refactor(ivy): remove superfluous isComponentDef function (#28880)
PR Close #28880
This commit is contained in:
parent
7c20bf8845
commit
230a941c3f
@ -7,24 +7,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {Type} from '../../interface/type';
|
import {Type} from '../../interface/type';
|
||||||
import {Component} from '../../metadata/directives';
|
|
||||||
import {fillProperties} from '../../util/property';
|
import {fillProperties} from '../../util/property';
|
||||||
import {EMPTY_ARRAY, EMPTY_OBJ} from '../empty';
|
import {EMPTY_ARRAY, EMPTY_OBJ} from '../empty';
|
||||||
import {ComponentDef, DirectiveDef, DirectiveDefFeature, RenderFlags} from '../interfaces/definition';
|
import {ComponentDef, DirectiveDef, DirectiveDefFeature, RenderFlags} from '../interfaces/definition';
|
||||||
|
import {isComponentDef} from '../util';
|
||||||
|
|
||||||
import {NgOnChangesFeature} from './ng_onchanges_feature';
|
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>&
|
function getSuperType(type: Type<any>): Type<any>&
|
||||||
{ngComponentDef?: ComponentDef<any>, ngDirectiveDef?: DirectiveDef<any>} {
|
{ngComponentDef?: ComponentDef<any>, ngDirectiveDef?: DirectiveDef<any>} {
|
||||||
return Object.getPrototypeOf(type.prototype).constructor;
|
return Object.getPrototypeOf(type.prototype).constructor;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user