MCPcopy
hub / github.com/ThatGuySam/doesitarm / headOk

Function headOk

helpers/http.js:228–244  ·  view source on GitHub ↗
( url, options = {} )

Source from the content-addressed store, hash-verified

226}
227
228export 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}

Callers 2

fetchAllUrlsFromSitemapsFunction · 0.90
http.test.tsFile · 0.90

Calls 1

requestFunction · 0.85

Tested by

no test coverage detected