@phaserjs/phaser
Version:
11 lines (10 loc) • 329 B
JavaScript
import { DepthFirstSearch } from "./DepthFirstSearch";
export function GetAllChildren(parent, property, value) {
const children = DepthFirstSearch(parent);
if (!property) {
return children;
}
return children.filter((child) => {
return property in child && (value === void 0 || child[property] === value);
});
}