Use any instead of Object
This commit is contained in:
parent
d2c70afd37
commit
ac8eb94a27
81 changed files with 398 additions and 397 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue