diff options
| author | otofune <otofune@gmail.com> | 2017-11-06 16:32:01 +0900 |
|---|---|---|
| committer | otofune <otofune@gmail.com> | 2017-11-06 16:32:01 +0900 |
| commit | d5cc4cc9c28eb6a981ce37859def97cd7c57abc6 (patch) | |
| tree | bd9716aa1943210968456940f594b831e3556c68 /src/api/common | |
| parent | remove console (diff) | |
| download | sharkey-d5cc4cc9c28eb6a981ce37859def97cd7c57abc6.tar.gz sharkey-d5cc4cc9c28eb6a981ce37859def97cd7c57abc6.tar.bz2 sharkey-d5cc4cc9c28eb6a981ce37859def97cd7c57abc6.zip | |
fix lint (automattic)
Diffstat (limited to 'src/api/common')
| -rw-r--r-- | src/api/common/add-file-to-drive.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/api/common/add-file-to-drive.ts b/src/api/common/add-file-to-drive.ts index dff2d52356..f9c22ccacd 100644 --- a/src/api/common/add-file-to-drive.ts +++ b/src/api/common/add-file-to-drive.ts @@ -14,16 +14,16 @@ import { Duplex } from 'stream'; const log = debug('misskey:register-drive-file'); const addToGridFS = (name, binary, metadata): Promise<any> => new Promise(async (resolve, reject) => { - const dataStream = new Duplex() - dataStream.push(binary) - dataStream.push(null) + const dataStream = new Duplex(); + dataStream.push(binary); + dataStream.push(null); - const bucket = await getGridFSBucket() - const writeStream = bucket.openUploadStream(name, { metadata }) - writeStream.once('finish', (doc) => { resolve(doc) }) - writeStream.on('error', reject) - dataStream.pipe(writeStream) -}) + const bucket = await getGridFSBucket(); + const writeStream = bucket.openUploadStream(name, { metadata }); + writeStream.once('finish', (doc) => { resolve(doc); }); + writeStream.on('error', reject); + dataStream.pipe(writeStream); +}); /** * Add file to drive |