@realfavicongenerator/check-favicon
Version:
Check the favicon of a website
13 lines (11 loc) • 406 B
text/typescript
import { CheckerMessage, FetchResponse, Fetcher } from "./types";
import { parse } from 'node-html-parser'
export const testFetcher = (database: { [url: string]: FetchResponse }): Fetcher => {
return async (url, contentType) => {
const res = database[url];
if (!res) {
return { status: 404, contentType: contentType || 'application/octet-stream' };
}
return res;
}
}