diff options
| author | Pitu <[email protected]> | 2020-12-24 23:45:16 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2020-12-24 23:45:16 +0900 |
| commit | fb2c27086f570fec60f4d52dcc9ca80e53186293 (patch) | |
| tree | 4c4fd056c293b8e0de632023ef19fdea95c009fa /src/api/structures | |
| parent | Merge pull request #228 from Zephyrrus/begone_trailing_commas (diff) | |
| download | host.fuwn.me-fb2c27086f570fec60f4d52dcc9ca80e53186293.tar.xz host.fuwn.me-fb2c27086f570fec60f4d52dcc9ca80e53186293.zip | |
Fix ESLint rules once and for all
Diffstat (limited to 'src/api/structures')
| -rw-r--r-- | src/api/structures/Route.js | 8 | ||||
| -rw-r--r-- | src/api/structures/Server.js | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/api/structures/Route.js b/src/api/structures/Route.js index 74589c5..3806325 100644 --- a/src/api/structures/Route.js +++ b/src/api/structures/Route.js @@ -9,7 +9,7 @@ const db = require('knex')({ database: process.env.DB_DATABASE, filename: nodePath.join(__dirname, '../../../database.sqlite') }, - postProcessResponse: (result) => { + postProcessResponse: result => { /* Fun fact: Depending on the database used by the user and given that I don't want to force a specific database for everyone because of the nature of this project, @@ -18,8 +18,8 @@ const db = require('knex')({ */ const booleanFields = ['enabled', 'enableDownload', 'isAdmin']; - const processResponse = (row) => { - Object.keys(row).forEach((key) => { + const processResponse = row => { + Object.keys(row).forEach(key => { if (booleanFields.includes(key)) { if (row[key] === 0) row[key] = false; else if (row[key] === 1) row[key] = true; @@ -28,7 +28,7 @@ const db = require('knex')({ return row; }; - if (Array.isArray(result)) return result.map((row) => processResponse(row)); + if (Array.isArray(result)) return result.map(row => processResponse(row)); if (typeof result === 'object') return processResponse(result); return result; }, diff --git a/src/api/structures/Server.js b/src/api/structures/Server.js index 83b2880..0ef91fd 100644 --- a/src/api/structures/Server.js +++ b/src/api/structures/Server.js @@ -42,16 +42,16 @@ class Server { if (ext) { ext = `.${ext.toLowerCase()}`; } if ( - ThumbUtil.imageExtensions.indexOf(ext) > -1 - || ThumbUtil.videoExtensions.indexOf(ext) > -1 - || req.path.indexOf('_nuxt') > -1 - || req.path.indexOf('favicon.ico') > -1 + ThumbUtil.imageExtensions.indexOf(ext) > -1 || + ThumbUtil.videoExtensions.indexOf(ext) > -1 || + req.path.indexOf('_nuxt') > -1 || + req.path.indexOf('favicon.ico') > -1 ) { return true; } return false; }, - 'stream': { + stream: { write(str) { log.debug(str); } } })); @@ -64,7 +64,7 @@ class Server { } registerAllTheRoutes() { - jetpack.find(this.routesFolder, { matching: '*.js' }).forEach((routeFile) => { + jetpack.find(this.routesFolder, { matching: '*.js' }).forEach(routeFile => { // eslint-disable-next-line import/no-dynamic-require, global-require const RouteClass = require(path.join('../../../', routeFile)); let routes = [RouteClass]; |