import * as allImages from '@ant-design/hitu-assets' ; const names = Object . keys ( allImages ) ; export function randomName ( types , prevName ? ) { const filteredNames = names . filter ( name => { let match = false ; for ( let i = 0 ; i < types . length ; i += 1 ) { const type = types [ i ] ; if ( type [ 0 ] === '!' ) { if ( name . includes ( type . slice ( 1 ) ) ) { return false ; } } else if ( name . includes ( type ) ) { match = true ; } } return match ; } ) ; const index = Math . floor ( Math . random ( ) * filteredNames . length ) ; const name = filteredNames [ index ] ; if ( prevName === name ) { return randomName ( types , prevName ) ; } return name ; } export function getComponent ( name ) { return ( allImages as any ) [ name ] ; }