import * as PIXI from 'pixi.js' ; export default class ElementFinder { findByName ( name , node ) { return this . __findByName ( name , node ) ; } __findByName ( name , node ) { const foundNodes = [ ] ; if ( node . name === name ) foundNodes . push ( node ) ; node . children . forEach ( ( child ) => { this . __findByName ( name , child as PIXI . Container ) . forEach ( ( subnode ) => { foundNodes . push ( subnode ) ; } ) ; } ) ; return foundNodes ; } }