From 075f16caac5236cb04c98ae7b3a989766d764bb3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Jul 2017 17:04:57 +0200 Subject: Remove "function" in favor of () => {} --- server/initializers/checker.ts | 2 +- server/initializers/database.ts | 6 +++--- server/initializers/migrator.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'server/initializers') diff --git a/server/initializers/checker.ts b/server/initializers/checker.ts index fb69e05fc..e4ca26f9c 100644 --- a/server/initializers/checker.ts +++ b/server/initializers/checker.ts @@ -45,7 +45,7 @@ function checkFFmpeg () { if (CONFIG.TRANSCODING.ENABLED === false) return undefined const canEncode = [ 'libx264' ] - canEncode.forEach(function (codec) { + canEncode.forEach(codec => { if (codecs[codec] === undefined) { throw new Error('Unknown codec ' + codec + ' in FFmpeg.') } diff --git a/server/initializers/database.ts b/server/initializers/database.ts index 6e3a8d009..9e691bf1d 100644 --- a/server/initializers/database.ts +++ b/server/initializers/database.ts @@ -60,7 +60,7 @@ const sequelize = new Sequelize(dbname, username, password, { port: CONFIG.DATABASE.PORT, benchmark: isTestInstance(), - logging: function (message: string, benchmark: number) { + logging: (message: string, benchmark: number) => { let newMessage = message if (benchmark !== undefined) { newMessage += ' | ' + benchmark + 'ms' @@ -72,7 +72,7 @@ const sequelize = new Sequelize(dbname, username, password, { database.sequelize = sequelize -database.init = function (silent: boolean) { +database.init = (silent: boolean) => { const modelDirectory = join(__dirname, '..', 'models') return getModelFiles(modelDirectory).then(filePaths => { @@ -105,7 +105,7 @@ export { function getModelFiles (modelDirectory: string) { return readdirPromise(modelDirectory) .then(files => { - const directories: string[] = files.filter(function (directory) { + const directories: string[] = files.filter(directory => { // Find directories if ( directory.endsWith('.js.map') || diff --git a/server/initializers/migrator.ts b/server/initializers/migrator.ts index 4b3be6d16..71a656c59 100644 --- a/server/initializers/migrator.ts +++ b/server/initializers/migrator.ts @@ -64,7 +64,7 @@ function getMigrationScripts () { script: string }[] = [] - files.forEach(function (file) { + files.forEach(file => { // Filename is something like 'version-blabla.js' const version = file.split('-')[0] filesToMigrate.push({ -- cgit v1.2.3