22 lines
904 B
JavaScript
22 lines
904 B
JavaScript
import { isVirtualElement } from './isVirtualElement';
|
|
/**
|
|
* Gets the elements which are child elements of the given element.
|
|
* If `allowVirtualChildren` is `true`, this method enumerates virtual child elements
|
|
* after the original children.
|
|
* @param parent - The element to get the children of.
|
|
* @param allowVirtualChildren - true if the method should enumerate virtual child elements.
|
|
*/
|
|
export function getChildren(parent, allowVirtualChildren) {
|
|
if (allowVirtualChildren === void 0) { allowVirtualChildren = true; }
|
|
var children = [];
|
|
if (parent) {
|
|
for (var i = 0; i < parent.children.length; i++) {
|
|
children.push(parent.children.item(i));
|
|
}
|
|
if (allowVirtualChildren && isVirtualElement(parent)) {
|
|
children.push.apply(children, parent._virtual.children);
|
|
}
|
|
}
|
|
return children;
|
|
}
|
|
//# sourceMappingURL=getChildren.js.map
|