import { SKLayer } from '../types' ; param layers const handleHideLayer = ( layers ) : SKLayer [ ] => { const layerArr = [ ] ; layers . forEach ( ( layer ) => { if ( layer . isVisible ) { if ( Array . isArray ( layer . layers ) ) { layer . layers = handleHideLayer ( layer . layers ) ; } layerArr . push ( layer ) ; } } ) ; return layerArr ; } ; export default handleHideLayer ;