aboutsummaryrefslogtreecommitdiff
path: root/webAO/utils/fileExists.ts
blob: f1a9924db0d0a19cfa3e0d0cf0e1ad2bcb90a6a3 (plain)
1
2
3
4
5
6
7
8
9
export default async function fileExists(url: string): Promise<boolean> {
    return fetch(url, {
        method: 'HEAD',
    }).then((response) => {
        return response.ok;
    }).catch(() => {
        return false;
    });
}