Remove "function" in favor of () => {}

This commit is contained in:
Chocobozzz
2017-07-11 17:04:57 +02:00
parent 4e979c3e1b
commit 075f16caac
25 changed files with 85 additions and 90 deletions

View File

@@ -111,7 +111,7 @@ function quickAndDirtyUpdateVideoToFriends (qaduParam: QaduParam, transaction?:
function quickAndDirtyUpdatesVideoToFriends (qadusParams: QaduParam[], transaction: Sequelize.Transaction) {
const tasks = []
qadusParams.forEach(function (qaduParams) {
qadusParams.forEach(qaduParams => {
tasks.push(quickAndDirtyUpdateVideoToFriends(qaduParams, transaction))
})
@@ -130,7 +130,7 @@ function addEventToRemoteVideo (eventParam: EventParam, transaction?: Sequelize.
function addEventsToRemoteVideo (eventsParams: EventParam[], transaction: Sequelize.Transaction) {
const tasks = []
eventsParams.forEach(function (eventParams) {
eventsParams.forEach(eventParams => {
tasks.push(addEventToRemoteVideo(eventParams, transaction))
})
@@ -307,7 +307,7 @@ function getForeignPodsList (host: string) {
return new Promise< ResultList<FormatedPod> >((res, rej) => {
const path = '/api/' + API_VERSION + '/pods'
request.get(REMOTE_SCHEME.HTTP + '://' + host + path, function (err, response, body) {
request.get(REMOTE_SCHEME.HTTP + '://' + host + path, (err, response, body) => {
if (err) return rej(err)
try {

View File

@@ -27,7 +27,7 @@ function getRefreshToken (refreshToken: string) {
function getUser (username: string, password: string) {
logger.debug('Getting User (username: ' + username + ', password: ' + password + ').')
return db.User.getByUsername(username).then(function (user) {
return db.User.getByUsername(username).then(user => {
if (!user) return null
return user.isPasswordMatch(password).then(passwordMatch => {
@@ -39,7 +39,7 @@ function getUser (username: string, password: string) {
}
function revokeToken (token: TokenInfo) {
return db.OAuthToken.getByRefreshTokenAndPopulateUser(token.refreshToken).then(function (tokenDB) {
return db.OAuthToken.getByRefreshTokenAndPopulateUser(token.refreshToken).then(tokenDB => {
if (tokenDB) tokenDB.destroy()
/*