aboutsummaryrefslogtreecommitdiff
path: root/webAO/utils/fileExists.js
diff options
context:
space:
mode:
authorstonedDiscord <Tukz@gmx.de>2022-03-11 12:46:07 +0100
committerGitHub <noreply@github.com>2022-03-11 12:46:07 +0100
commit4b918084e413933cfc819bd1a1246c6a1ac13e31 (patch)
treed01a1ef9c4818336fd82330855e09a74824a5fa7 /webAO/utils/fileExists.js
parent6dd1b296c2dd1d7462dd8514dff43db59ac8dd19 (diff)
parent20424a76b00b303a94921a1b3c5fec6495471f0c (diff)
Merge pull request #101 from caleb-mabry/remove-unused-code
Magnum Opus Pt1
Diffstat (limited to 'webAO/utils/fileExists.js')
-rw-r--r--webAO/utils/fileExists.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/webAO/utils/fileExists.js b/webAO/utils/fileExists.js
new file mode 100644
index 0000000..6d32a1e
--- /dev/null
+++ b/webAO/utils/fileExists.js
@@ -0,0 +1,8 @@
+const fileExists = async (url) => {
+ const xhr = new XMLHttpRequest();
+ xhr.open('HEAD', url, false);
+ xhr.send();
+
+ return xhr.status === 200;
+};
+export default fileExists;