Skip to content

Commit

Permalink
Follow linter
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Mar 3, 2017
1 parent 4e3d617 commit 3c1b92b
Show file tree
Hide file tree
Showing 70 changed files with 476 additions and 742 deletions.
12 changes: 4 additions & 8 deletions src/api/endpoints/aggregation/posts/like.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Module dependencies
*/
Expand All @@ -13,9 +11,7 @@ import Like from '../../../models/like';
* @param {any} params
* @return {Promise<any>}
*/
module.exports = (params) =>
new Promise(async (res, rej) =>
{
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'post_id' parameter
const [postId, postIdErr] = it(params.post_id).expect.id().required().qed();
if (postIdErr) return rej('invalid post_id param');
Expand Down Expand Up @@ -63,7 +59,7 @@ module.exports = (params) =>
)[0];

if (data) {
graph.push(data)
graph.push(data);
} else {
graph.push({
date: {
Expand All @@ -72,8 +68,8 @@ module.exports = (params) =>
day: day.getDate()
},
count: 0
})
};
});
}
}

res(graph);
Expand Down
6 changes: 1 addition & 5 deletions src/api/endpoints/aggregation/posts/likes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Module dependencies
*/
Expand All @@ -13,9 +11,7 @@ import Like from '../../../models/like';
* @param {any} params
* @return {Promise<any>}
*/
module.exports = (params) =>
new Promise(async (res, rej) =>
{
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'post_id' parameter
const [postId, postIdErr] = it(params.post_id).expect.id().required().qed();
if (postIdErr) return rej('invalid post_id param');
Expand Down
12 changes: 4 additions & 8 deletions src/api/endpoints/aggregation/posts/reply.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Module dependencies
*/
Expand All @@ -12,9 +10,7 @@ import Post from '../../../models/post';
* @param {any} params
* @return {Promise<any>}
*/
module.exports = (params) =>
new Promise(async (res, rej) =>
{
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'post_id' parameter
const [postId, postIdErr] = it(params.post_id).expect.id().required().qed();
if (postIdErr) return rej('invalid post_id param');
Expand Down Expand Up @@ -62,7 +58,7 @@ module.exports = (params) =>
)[0];

if (data) {
graph.push(data)
graph.push(data);
} else {
graph.push({
date: {
Expand All @@ -71,8 +67,8 @@ module.exports = (params) =>
day: day.getDate()
},
count: 0
})
};
});
}
}

res(graph);
Expand Down
12 changes: 4 additions & 8 deletions src/api/endpoints/aggregation/posts/repost.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Module dependencies
*/
Expand All @@ -12,9 +10,7 @@ import Post from '../../../models/post';
* @param {any} params
* @return {Promise<any>}
*/
module.exports = (params) =>
new Promise(async (res, rej) =>
{
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'post_id' parameter
const [postId, postIdErr] = it(params.post_id).expect.id().required().qed();
if (postIdErr) return rej('invalid post_id param');
Expand Down Expand Up @@ -62,7 +58,7 @@ module.exports = (params) =>
)[0];

if (data) {
graph.push(data)
graph.push(data);
} else {
graph.push({
date: {
Expand All @@ -71,8 +67,8 @@ module.exports = (params) =>
day: day.getDate()
},
count: 0
})
};
});
}
}

res(graph);
Expand Down
6 changes: 1 addition & 5 deletions src/api/endpoints/aggregation/users/followers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Module dependencies
*/
Expand All @@ -13,9 +11,7 @@ import Following from '../../../models/following';
* @param {any} params
* @return {Promise<any>}
*/
module.exports = (params) =>
new Promise(async (res, rej) =>
{
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'user_id' parameter
const [userId, userIdErr] = it(params.user_id).expect.id().required().qed();
if (userIdErr) return rej('invalid user_id param');
Expand Down
6 changes: 1 addition & 5 deletions src/api/endpoints/aggregation/users/following.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Module dependencies
*/
Expand All @@ -13,9 +11,7 @@ import Following from '../../../models/following';
* @param {any} params
* @return {Promise<any>}
*/
module.exports = (params) =>
new Promise(async (res, rej) =>
{
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'user_id' parameter
const [userId, userIdErr] = it(params.user_id).expect.id().required().qed();
if (userIdErr) return rej('invalid user_id param');
Expand Down
12 changes: 4 additions & 8 deletions src/api/endpoints/aggregation/users/like.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Module dependencies
*/
Expand All @@ -13,9 +11,7 @@ import Like from '../../../models/like';
* @param {any} params
* @return {Promise<any>}
*/
module.exports = (params) =>
new Promise(async (res, rej) =>
{
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'user_id' parameter
const [userId, userIdErr] = it(params.user_id).expect.id().required().qed();
if (userIdErr) return rej('invalid user_id param');
Expand Down Expand Up @@ -67,7 +63,7 @@ module.exports = (params) =>
)[0];

if (data) {
graph.push(data)
graph.push(data);
} else {
graph.push({
date: {
Expand All @@ -76,8 +72,8 @@ module.exports = (params) =>
day: day.getDate()
},
count: 0
})
};
});
}
}

res(graph);
Expand Down
12 changes: 4 additions & 8 deletions src/api/endpoints/aggregation/users/post.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Module dependencies
*/
Expand All @@ -13,9 +11,7 @@ import Post from '../../../models/post';
* @param {any} params
* @return {Promise<any>}
*/
module.exports = (params) =>
new Promise(async (res, rej) =>
{
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'user_id' parameter
const [userId, userIdErr] = it(params.user_id).expect.id().required().qed();
if (userIdErr) return rej('invalid user_id param');
Expand Down Expand Up @@ -95,7 +91,7 @@ module.exports = (params) =>
)[0];

if (data) {
graph.push(data)
graph.push(data);
} else {
graph.push({
date: {
Expand All @@ -106,8 +102,8 @@ module.exports = (params) =>
posts: 0,
reposts: 0,
replies: 0
})
};
});
}
}

res(graph);
Expand Down
6 changes: 1 addition & 5 deletions src/api/endpoints/app/create.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Module dependencies
*/
Expand Down Expand Up @@ -69,9 +67,7 @@ import serialize from '../../serializers/app';
* @param {any} user
* @return {Promise<any>}
*/
module.exports = async (params, user) =>
new Promise(async (res, rej) =>
{
module.exports = async (params, user) => new Promise(async (res, rej) => {
// Get 'name_id' parameter
const [nameId, nameIdErr] = it(params.name_id).expect.string().required().validate(isValidNameId).qed();
if (nameIdErr) return rej('invalid name_id param');
Expand Down
6 changes: 1 addition & 5 deletions src/api/endpoints/app/name_id/available.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Module dependencies
*/
Expand Down Expand Up @@ -42,9 +40,7 @@ import { isValidNameId } from '../../../models/app';
* @param {any} params
* @return {Promise<any>}
*/
module.exports = async (params) =>
new Promise(async (res, rej) =>
{
module.exports = async (params) => new Promise(async (res, rej) => {
// Get 'name_id' parameter
const [nameId, nameIdErr] = it(params.name_id).expect.string().required().validate(isValidNameId).qed();
if (nameIdErr) return rej('invalid name_id param');
Expand Down
6 changes: 1 addition & 5 deletions src/api/endpoints/app/show.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Module dependencies
*/
Expand Down Expand Up @@ -46,9 +44,7 @@ import serialize from '../../serializers/app';
* @param {any} isSecure
* @return {Promise<any>}
*/
module.exports = (params, user, _, isSecure) =>
new Promise(async (res, rej) =>
{
module.exports = (params, user, _, isSecure) => new Promise(async (res, rej) => {
// Get 'app_id' parameter
const [appId, appIdErr] = it(params.app_id, 'id');
if (appIdErr) return rej('invalid app_id param');
Expand Down
6 changes: 1 addition & 5 deletions src/api/endpoints/auth/accept.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Module dependencies
*/
Expand Down Expand Up @@ -40,9 +38,7 @@ import AccessToken from '../../models/access-token';
* @param {any} user
* @return {Promise<any>}
*/
module.exports = (params, user) =>
new Promise(async (res, rej) =>
{
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'token' parameter
const [token, tokenErr] = it(params.token).expect.string().required().qed();
if (tokenErr) return rej('invalid token param');
Expand Down
6 changes: 1 addition & 5 deletions src/api/endpoints/auth/session/generate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Module dependencies
*/
Expand Down Expand Up @@ -46,9 +44,7 @@ import config from '../../../../conf';
* @param {any} params
* @return {Promise<any>}
*/
module.exports = (params) =>
new Promise(async (res, rej) =>
{
module.exports = (params) => new Promise(async (res, rej) => {
// Get 'app_secret' parameter
const [appSecret, appSecretErr] = it(params.app_secret).expect.string().required().qed();
if (appSecretErr) return rej('invalid app_secret param');
Expand Down
6 changes: 1 addition & 5 deletions src/api/endpoints/auth/session/show.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Module dependencies
*/
Expand Down Expand Up @@ -54,9 +52,7 @@ import serialize from '../../../serializers/auth-session';
* @param {any} user
* @return {Promise<any>}
*/
module.exports = (params, user) =>
new Promise(async (res, rej) =>
{
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'token' parameter
const [token, tokenErr] = it(params.token).expect.string().required().qed();
if (tokenErr) return rej('invalid token param');
Expand Down
Loading

0 comments on commit 3c1b92b

Please sign in to comment.