From 2484c63d77e05fff384cc08b6ea46a29a22a62ec Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Tue, 5 Oct 2021 16:46:55 +0200 Subject: chore: repo maintenance (#732) --- recipes/misskey/index.js | 54 +++++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 26 deletions(-) (limited to 'recipes/misskey/index.js') diff --git a/recipes/misskey/index.js b/recipes/misskey/index.js index 3f51bf9..5805c37 100644 --- a/recipes/misskey/index.js +++ b/recipes/misskey/index.js @@ -1,28 +1,30 @@ -module.exports = Ferdi => class Misskey extends Ferdi { - constructor(...args) { - let _temp; - return _temp = super(...args), this.events = { - }, _temp; - } +module.exports = Ferdi => + class Misskey extends Ferdi { + constructor(...args) { + let _temp; + // eslint-disable-next-line constructor-super + return (_temp = super(...args)), (this.events = {}), _temp; + } - async validateUrl(url) { - try { - const res = await window.fetch(`${url}/api/stats`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - }); - const data = await res.json(); - // check any field in API response - return [ - 'originalUsersCount', 'usersCount', 'notesCount', 'originalNotesCount' - ].reduce((r, key) => ( - r && Object.hasOwnProperty.call(data, 'uri') - ), true); - } catch (err) { - console.error(err); + async validateUrl(url) { + try { + const res = await window.fetch(`${url}/api/stats`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }); + const data = await res.json(); + // check any field in API response + return [ + 'originalUsersCount', + 'usersCount', + 'notesCount', + 'originalNotesCount', + ].reduce(r => r && Object.hasOwnProperty.call(data, 'uri'), true); + } catch (err) { + console.error(err); + } + return false; } - return false; - } -}; + }; -- cgit v1.2.3-70-g09d2