( url, options = {} )
| 226 | } |
| 227 | |
| 228 | export async function headOk ( url, options = {} ) { |
| 229 | try { |
| 230 | await request( url, { |
| 231 | ...options, |
| 232 | method: 'HEAD', |
| 233 | responseType: 'none' |
| 234 | } ) |
| 235 | |
| 236 | return true |
| 237 | } catch ( error ) { |
| 238 | if ( error instanceof Error ) { |
| 239 | return false |
| 240 | } |
| 241 | |
| 242 | throw error |
| 243 | } |
| 244 | } |
no test coverage detected