import { SKLayer } from '../types' ; description param { SKLayer [ ] } layers param { SKLayer [ ] } afterLayer returns { SKLayer [ ] } const filterGroupLayer = ( layers , afterLayer = [ ] , type ) : SKLayer [ ] => { layers . forEach ( ( layer ) => { if ( layer . _class !== 'group' || layer . symbolComponentObject || layer . haikuiComponentInfo ) { afterLayer . push ( { ... layer , layers : [ ] } ) ; } if ( Array . isArray ( layer . layers ) ) { filterGroupLayer ( layer . layers , afterLayer , type ) ; } } ) ; return afterLayer ; } ; export default filterGroupLayer ;