export namespace ArrayUtil { export function has < T > ( array , ... items ) { return items . every ( elem => array . find ( org => org === elem ) !== undefined ) ; } export async function asyncMap < Input , Output > ( array , closure ) { const ret = [ ] ; for ( const elem of array ) ret . push ( await closure ( elem ) ) ; return ret ; } export async function asyncFilter < Input > ( array , closure ) { const ret = [ ] ; for ( const elem of array ) if ( await closure ( elem ) === true ) ret . push ( elem ) ; return ret ; } }