aboutsummaryrefslogtreecommitdiff
path: root/webAO/utils/fileExists.js
diff options
context:
space:
mode:
authorstonedDiscord <Tukz@gmx.de>2023-09-20 12:57:45 +0200
committerstonedDiscord <Tukz@gmx.de>2023-09-20 12:57:45 +0200
commit59028dd4046ad0715d80be8d1ed0031f20f05b7a (patch)
treec66c470ad4fb959b8959f1895e410762c557437b /webAO/utils/fileExists.js
parentef28c355ef69fee7511956751bbdb5dcd1a931b1 (diff)
mostly whitespaces, please don't break
Diffstat (limited to 'webAO/utils/fileExists.js')
-rw-r--r--webAO/utils/fileExists.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/webAO/utils/fileExists.js b/webAO/utils/fileExists.js
index a4b3b80..5b60976 100644
--- a/webAO/utils/fileExists.js
+++ b/webAO/utils/fileExists.js
@@ -1,18 +1,18 @@
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 {
+ 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.onerror = function checkError() {
- resolve(false);
- };
- xhr.send(null);
+ };
+ xhr.send(null);
});
export default fileExists;