From ac8eb94a27905a1bcac9fea445b41e5866cf173f Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Wed, 1 Mar 2017 17:37:01 +0900 Subject: Use any instead of Object --- src/api/serializers/app.ts | 12 ++++++------ src/api/serializers/auth-session.ts | 6 +++--- src/api/serializers/drive-file.ts | 24 ++++++++++++------------ src/api/serializers/drive-folder.ts | 12 ++++++------ src/api/serializers/drive-tag.ts | 10 +++++----- src/api/serializers/messaging-message.ts | 10 +++++----- src/api/serializers/notification.ts | 6 +++--- src/api/serializers/post.ts | 10 +++++----- src/api/serializers/signin.ts | 6 +++--- src/api/serializers/user.ts | 8 ++++---- 10 files changed, 52 insertions(+), 52 deletions(-) (limited to 'src/api/serializers') diff --git a/src/api/serializers/app.ts b/src/api/serializers/app.ts index bb599dc461..9a02c5637a 100644 --- a/src/api/serializers/app.ts +++ b/src/api/serializers/app.ts @@ -12,10 +12,10 @@ import config from '../../conf'; /** * Serialize an app * - * @param {Object} app - * @param {Object} me? - * @param {Object} options? - * @return {Promise} + * @param {any} app + * @param {any} me? + * @param {any} options? + * @return {Promise} */ export default ( app: any, @@ -75,8 +75,8 @@ export default ( app_id: _app.id, user_id: me, }, { - limit: 1 - }); + limit: 1 + }); _app.is_authorized = exist === 1; } diff --git a/src/api/serializers/auth-session.ts b/src/api/serializers/auth-session.ts index b2dc93d3ff..4efb7729c4 100644 --- a/src/api/serializers/auth-session.ts +++ b/src/api/serializers/auth-session.ts @@ -10,9 +10,9 @@ import serializeApp from './app'; /** * Serialize an auth session * - * @param {Object} session - * @param {Object} me? - * @return {Promise} + * @param {any} session + * @param {any} me? + * @return {Promise} */ export default ( session: any, diff --git a/src/api/serializers/drive-file.ts b/src/api/serializers/drive-file.ts index 02241c2261..e6e2f6cae3 100644 --- a/src/api/serializers/drive-file.ts +++ b/src/api/serializers/drive-file.ts @@ -13,16 +13,16 @@ import config from '../../conf'; /** * Serialize a drive file * - * @param {Object} file - * @param {Object} options? - * @return {Promise} + * @param {any} file + * @param {any} options? + * @return {Promise} */ export default ( file: any, options?: { detail: boolean } -) => new Promise(async (resolve, reject) => { +) => new Promise(async (resolve, reject) => { const opts = Object.assign({ detail: false }, options); @@ -34,18 +34,18 @@ export default ( _file = await DriveFile.findOne({ _id: file }, { - fields: { - data: false - } - }); + fields: { + data: false + } + }); } else if (typeof file === 'string') { _file = await DriveFile.findOne({ _id: new mongo.ObjectID(file) }, { - fields: { - data: false - } - }); + fields: { + data: false + } + }); } else { _file = deepcopy(file); } diff --git a/src/api/serializers/drive-folder.ts b/src/api/serializers/drive-folder.ts index a5339ce96c..ac3bd13c3a 100644 --- a/src/api/serializers/drive-folder.ts +++ b/src/api/serializers/drive-folder.ts @@ -10,16 +10,16 @@ import deepcopy = require('deepcopy'); /** * Serialize a drive folder * - * @param {Object} folder - * @param {Object} options? - * @return {Promise} + * @param {any} folder + * @param {any} options? + * @return {Promise} */ const self = ( folder: any, options?: { detail: boolean } -) => new Promise(async (resolve, reject) => { +) => new Promise(async (resolve, reject) => { const opts = Object.assign({ detail: false }, options); @@ -28,9 +28,9 @@ const self = ( // Populate the folder if 'folder' is ID if (mongo.ObjectID.prototype.isPrototypeOf(folder)) { - _folder = await DriveFolder.findOne({_id: folder}); + _folder = await DriveFolder.findOne({ _id: folder }); } else if (typeof folder === 'string') { - _folder = await DriveFolder.findOne({_id: new mongo.ObjectID(folder)}); + _folder = await DriveFolder.findOne({ _id: new mongo.ObjectID(folder) }); } else { _folder = deepcopy(folder); } diff --git a/src/api/serializers/drive-tag.ts b/src/api/serializers/drive-tag.ts index 603b1d7d3e..3e800ca5bd 100644 --- a/src/api/serializers/drive-tag.ts +++ b/src/api/serializers/drive-tag.ts @@ -10,19 +10,19 @@ import deepcopy = require('deepcopy'); /** * Serialize a drive tag * - * @param {Object} tag - * @return {Promise} + * @param {any} tag + * @return {Promise} */ const self = ( tag: any -) => new Promise(async (resolve, reject) => { +) => new Promise(async (resolve, reject) => { let _tag: any; // Populate the tag if 'tag' is ID if (mongo.ObjectID.prototype.isPrototypeOf(tag)) { - _tag = await DriveTag.findOne({_id: tag}); + _tag = await DriveTag.findOne({ _id: tag }); } else if (typeof tag === 'string') { - _tag = await DriveTag.findOne({_id: new mongo.ObjectID(tag)}); + _tag = await DriveTag.findOne({ _id: new mongo.ObjectID(tag) }); } else { _tag = deepcopy(tag); } diff --git a/src/api/serializers/messaging-message.ts b/src/api/serializers/messaging-message.ts index c25b9968a6..4a4c8fc5b4 100644 --- a/src/api/serializers/messaging-message.ts +++ b/src/api/serializers/messaging-message.ts @@ -12,10 +12,10 @@ import deepcopy = require('deepcopy'); /** * Serialize a message * - * @param {Object} message - * @param {Object} me? - * @param {Object} options? - * @return {Promise} + * @param {any} message + * @param {any} me? + * @param {any} options? + * @return {Promise} */ export default ( message: any, @@ -23,7 +23,7 @@ export default ( options?: { populateRecipient: boolean } -) => new Promise(async (resolve, reject) => { +) => new Promise(async (resolve, reject) => { const opts = options || { populateRecipient: true }; diff --git a/src/api/serializers/notification.ts b/src/api/serializers/notification.ts index df86218aa7..43add127e0 100644 --- a/src/api/serializers/notification.ts +++ b/src/api/serializers/notification.ts @@ -12,10 +12,10 @@ import deepcopy = require('deepcopy'); /** * Serialize a notification * - * @param {Object} notification - * @return {Promise} + * @param {any} notification + * @return {Promise} */ -export default (notification: any) => new Promise(async (resolve, reject) => { +export default (notification: any) => new Promise(async (resolve, reject) => { let _notification: any; // Populate the notification if 'notification' is ID diff --git a/src/api/serializers/post.ts b/src/api/serializers/post.ts index 575cfc2394..b71b42e9a4 100644 --- a/src/api/serializers/post.ts +++ b/src/api/serializers/post.ts @@ -15,10 +15,10 @@ import deepcopy = require('deepcopy'); /** * Serialize a post * - * @param {Object} post - * @param {Object} me? - * @param {Object} options? - * @return {Promise} + * @param {any} post + * @param {any} me? + * @param {any} options? + * @return {Promise} */ const self = ( post: any, @@ -26,7 +26,7 @@ const self = ( options?: { detail: boolean } -) => new Promise(async (resolve, reject) => { +) => new Promise(async (resolve, reject) => { const opts = options || { detail: true, }; diff --git a/src/api/serializers/signin.ts b/src/api/serializers/signin.ts index 828a165383..39226f8bd4 100644 --- a/src/api/serializers/signin.ts +++ b/src/api/serializers/signin.ts @@ -8,12 +8,12 @@ import deepcopy = require('deepcopy'); /** * Serialize a signin record * - * @param {Object} record - * @return {Promise} + * @param {any} record + * @return {Promise} */ export default ( record: any -) => new Promise(async (resolve, reject) => { +) => new Promise(async (resolve, reject) => { const _record = deepcopy(record); diff --git a/src/api/serializers/user.ts b/src/api/serializers/user.ts index 09dc3e87dc..de215808a4 100644 --- a/src/api/serializers/user.ts +++ b/src/api/serializers/user.ts @@ -13,10 +13,10 @@ import config from '../../conf'; /** * Serialize a user * - * @param {Object} user - * @param {Object} me? - * @param {Object} options? - * @return {Promise} + * @param {any} user + * @param {any} me? + * @param {any} options? + * @return {Promise} */ export default ( user: any, -- cgit v1.2.3-freya