UNPKG

denoify

Version:

For NPM module authors that would like to support Deno but do not want to write and maintain a port.

7 lines (5 loc) 263 B
import { fetchWithTimeout } from "../tools/fetchWithTimeout"; /** Return true if 404 or 400 */ export function is404(url: string): Promise<boolean> { return fetchWithTimeout(url, { "timeout": 8000 }).then(({ status }) => status === 404 || status === 400); }