feat(ivy): add support of ApplicationRef.bootstrapModuleFactory (#23811)
PR Close #23811
This commit is contained in:
@ -6,16 +6,16 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {assertEqual, assertNotNull} from './assert';
|
||||
import {assertDefined, assertEqual} from './assert';
|
||||
import {LNode, TNodeType} from './interfaces/node';
|
||||
|
||||
export function assertNodeType(node: LNode, type: TNodeType) {
|
||||
assertNotNull(node, 'should be called with a node');
|
||||
assertDefined(node, 'should be called with a node');
|
||||
assertEqual(node.tNode.type, type, `should be a ${typeName(type)}`);
|
||||
}
|
||||
|
||||
export function assertNodeOfPossibleTypes(node: LNode, ...types: TNodeType[]) {
|
||||
assertNotNull(node, 'should be called with a node');
|
||||
assertDefined(node, 'should be called with a node');
|
||||
const found = types.some(type => node.tNode.type === type);
|
||||
assertEqual(found, true, `Should be one of ${types.map(typeName).join(', ')}`);
|
||||
}
|
||||
|
Reference in New Issue
Block a user