diff options
author | 2020-09-22 20:56:48 +0200 | |
---|---|---|
committer | 2020-09-22 19:56:48 +0100 | |
commit | 6f5e4a00588aefdda7a5a1cfe70935870e7e234a (patch) | |
tree | 9e29aa7aa0620a1a4a968ff8739b4b8ba96791a9 /recipes/grape/index.js | |
parent | Updated logos for Outlook/OWA (diff) | |
download | ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.gz ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.zst ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.zip |
Unpack recipes and update recipes icons (#292)
Co-authored-by: Amine Mouafik <amine@mouafik.fr>
Diffstat (limited to 'recipes/grape/index.js')
-rw-r--r-- | recipes/grape/index.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/recipes/grape/index.js b/recipes/grape/index.js new file mode 100644 index 0000000..2c9cd0c --- /dev/null +++ b/recipes/grape/index.js | |||
@@ -0,0 +1,21 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } | ||
4 | |||
5 | module.exports = Franz => class Grape extends Franz { | ||
6 | validateUrl(url) { | ||
7 | return _asyncToGenerator(function* () { | ||
8 | try { | ||
9 | const resp = yield window.fetch(url, { | ||
10 | method: 'GET' | ||
11 | }); | ||
12 | return resp.status === 200; | ||
13 | } catch (err) { | ||
14 | console.error(err); | ||
15 | } | ||
16 | |||
17 | return false; | ||
18 | })(); | ||
19 | } | ||
20 | }; | ||
21 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdyYXBlL2luZGV4LmpzIl0sIm5hbWVzIjpbIm1vZ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