aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/grape/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/grape/index.js')
-rw-r--r--recipes/grape/index.js48
1 files changed, 0 insertions, 48 deletions
diff --git a/recipes/grape/index.js b/recipes/grape/index.js
deleted file mode 100644
index 1e2a187..0000000
--- a/recipes/grape/index.js
+++ /dev/null
@@ -1,48 +0,0 @@
1function _asyncToGenerator(fn) {
2 return function () {
3 const gen = Reflect.apply(fn, this, arguments);
4 return new Promise((resolve, reject) => {
5 function step(key, arg) {
6 try {
7 var info = gen[key](arg);
8 var value = info.value;
9 } catch (error) {
10 reject(error);
11 return;
12 }
13 if (info.done) {
14 resolve(value);
15 } else {
16 // eslint-disable-next-line consistent-return
17 return Promise.resolve(value).then(
18 value => {
19 step('next', value);
20 },
21 error => {
22 step('throw', error);
23 },
24 );
25 }
26 }
27 return step('next');
28 });
29 };
30}
31
32module.exports = Ferdium =>
33 class Grape extends Ferdium {
34 validateUrl(url) {
35 return _asyncToGenerator(function* () {
36 try {
37 const resp = yield window.fetch(url, {
38 method: 'GET',
39 });
40 return resp.status === 200;
41 } catch (error) {
42 console.error(error);
43 }
44
45 return false;
46 })();
47 }
48 };