import { fetchFromApi } from './api/haveibeenpwned' ; import type { Breach } from './api/haveibeenpwned/types' ; param options param { string } options . domain param { string } options . baseUrl param { string } options . userAgent returns { Promise < Breach [ ] > } example example export function breaches ( options = { } ) { const endpoint = '/breaches?' ; const params = [ ] ; if ( options . domain ) { params . push ( `domain=${ encodeURIComponent ( options . domain ) }` ) ; } return fetchFromApi ( `${ endpoint }${ params . join ( '&' ) }` , { baseUrl : options . baseUrl , userAgent : options . userAgent , } ) as Promise < Breach [ ] > ; }