diff options
Diffstat (limited to 'webAO/utils/fileExists.js')
| -rw-r--r-- | webAO/utils/fileExists.js | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/webAO/utils/fileExists.js b/webAO/utils/fileExists.js deleted file mode 100644 index 5b60976..0000000 --- a/webAO/utils/fileExists.js +++ /dev/null @@ -1,18 +0,0 @@ -const fileExists = async (url) => new Promise((resolve) => { - const xhr = new XMLHttpRequest(); - xhr.open('HEAD', url); - xhr.onload = function checkLoad() { - if (xhr.readyState === 4) { - if (xhr.status === 200) { - resolve(true); - } else { - resolve(false); - } - } - }; - xhr.onerror = function checkError() { - resolve(false); - }; - xhr.send(null); -}); -export default fileExists; |
