import type * as d from '../../declarations' ; import { consoleDevError } from '@platform' ; import { h } from '@runtime' ; import { isPromise } from '@utils' ; export const hAsync = ( nodeName , vnodeData , ... children ) => { if ( Array . isArray ( children ) && children . length > 0 ) { const flatChildren = children . flat ( Infinity ) ; if ( flatChildren . some ( isPromise ) ) { return Promise . all ( flatChildren ) . then ( ( resolvedChildren ) => { return h ( nodeName , vnodeData , ... resolvedChildren ) ; } ) . catch ( ( err ) => { consoleDevError ( err ) ; return h ( nodeName , vnodeData ) ; } ) ; } return h ( nodeName , vnodeData , ... children ) ; } return h ( nodeName , vnodeData ) ; } ;