summaryrefslogtreecommitdiff
path: root/src/api/serializers
diff options
context:
space:
mode:
authorAya Morisawa <AyaMorisawa4869@gmail.com>2017-03-01 17:37:01 +0900
committerAya Morisawa <AyaMorisawa4869@gmail.com>2017-03-01 17:37:01 +0900
commitac8eb94a27905a1bcac9fea445b41e5866cf173f (patch)
treef2837b62d350356ae2f2f454960f2f22ab4a0d89 /src/api/serializers
parentUpdate tslint.json (diff)
downloadsharkey-ac8eb94a27905a1bcac9fea445b41e5866cf173f.tar.gz
sharkey-ac8eb94a27905a1bcac9fea445b41e5866cf173f.tar.bz2
sharkey-ac8eb94a27905a1bcac9fea445b41e5866cf173f.zip
Use any instead of Object
Diffstat (limited to 'src/api/serializers')
-rw-r--r--src/api/serializers/app.ts12
-rw-r--r--src/api/serializers/auth-session.ts6
-rw-r--r--src/api/serializers/drive-file.ts24
-rw-r--r--src/api/serializers/drive-folder.ts12
-rw-r--r--src/api/serializers/drive-tag.ts10
-rw-r--r--src/api/serializers/messaging-message.ts10
-rw-r--r--src/api/serializers/notification.ts6
-rw-r--r--src/api/serializers/post.ts10
-rw-r--r--src/api/serializers/signin.ts6
-rw-r--r--src/api/serializers/user.ts8
10 files changed, 52 insertions, 52 deletions
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<Object>}
+ * @param {any} app
+ * @param {any} me?
+ * @param {any} options?
+ * @return {Promise<any>}
*/
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<Object>}
+ * @param {any} session
+ * @param {any} me?
+ * @return {Promise<any>}
*/
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<Object>}
+ * @param {any} file
+ * @param {any} options?
+ * @return {Promise<any>}
*/
export default (
file: any,
options?: {
detail: boolean
}
-) => new Promise<Object>(async (resolve, reject) => {
+) => new Promise<any>(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<Object>}
+ * @param {any} folder
+ * @param {any} options?
+ * @return {Promise<any>}
*/
const self = (
folder: any,
options?: {
detail: boolean
}
-) => new Promise<Object>(async (resolve, reject) => {
+) => new Promise<any>(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<Object>}
+ * @param {any} tag
+ * @return {Promise<any>}
*/
const self = (
tag: any
-) => new Promise<Object>(async (resolve, reject) => {
+) => new Promise<any>(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<Object>}
+ * @param {any} message
+ * @param {any} me?
+ * @param {any} options?
+ * @return {Promise<any>}
*/
export default (
message: any,
@@ -23,7 +23,7 @@ export default (
options?: {
populateRecipient: boolean
}
-) => new Promise<Object>(async (resolve, reject) => {
+) => new Promise<any>(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<Object>}
+ * @param {any} notification
+ * @return {Promise<any>}
*/
-export default (notification: any) => new Promise<Object>(async (resolve, reject) => {
+export default (notification: any) => new Promise<any>(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<Object>}
+ * @param {any} post
+ * @param {any} me?
+ * @param {any} options?
+ * @return {Promise<any>}
*/
const self = (
post: any,
@@ -26,7 +26,7 @@ const self = (
options?: {
detail: boolean
}
-) => new Promise<Object>(async (resolve, reject) => {
+) => new Promise<any>(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<Object>}
+ * @param {any} record
+ * @return {Promise<any>}
*/
export default (
record: any
-) => new Promise<Object>(async (resolve, reject) => {
+) => new Promise<any>(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<Object>}
+ * @param {any} user
+ * @param {any} me?
+ * @param {any} options?
+ * @return {Promise<any>}
*/
export default (
user: any,