summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2019-04-13 01:43:22 +0900
committerGitHub <noreply@github.com>2019-04-13 01:43:22 +0900
commit987168b863c52d0548050ffbac569782bb9a8cef (patch)
treec9aa2243dcdcbd044688d201a51c601574bff259 /src/tools
parentFix bug (diff)
downloadmisskey-987168b863c52d0548050ffbac569782bb9a8cef.tar.gz
misskey-987168b863c52d0548050ffbac569782bb9a8cef.tar.bz2
misskey-987168b863c52d0548050ffbac569782bb9a8cef.zip
strictNullChecks (#4666)
* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/clean-remote-files.ts3
-rw-r--r--src/tools/show-signin-history.ts4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/tools/clean-remote-files.ts b/src/tools/clean-remote-files.ts
index f64affea97..e722552e14 100644
--- a/src/tools/clean-remote-files.ts
+++ b/src/tools/clean-remote-files.ts
@@ -3,6 +3,7 @@ import del from '../services/drive/delete-file';
import { DriveFiles } from '../models';
import { Not } from 'typeorm';
import { DriveFile } from '../models/entities/drive-file';
+import { ensure } from '../prelude/ensure';
const limit = promiseLimit(16);
@@ -17,7 +18,7 @@ DriveFiles.find({
});
async function job(file: DriveFile): Promise<any> {
- file = await DriveFiles.findOne(file.id);
+ file = await DriveFiles.findOne(file.id).then(ensure);
await del(file, true);
diff --git a/src/tools/show-signin-history.ts b/src/tools/show-signin-history.ts
index 584bece6bb..9e6e849f5d 100644
--- a/src/tools/show-signin-history.ts
+++ b/src/tools/show-signin-history.ts
@@ -9,7 +9,7 @@ import { Users, Signins } from '../models';
// node built/tools/show-signin-history username all
// with full request headers
-async function main(username: string, headers: string[]) {
+async function main(username: string, headers?: string[]) {
const user = await Users.findOne({
host: null,
usernameLower: username.toLowerCase(),
@@ -39,7 +39,7 @@ async function main(username: string, headers: string[]) {
const args = process.argv.slice(2);
let username = args[0];
-let headers: string[];
+let headers: string[] | undefined;
if (args[1] != null) {
headers = args[1].split(/,/).map(header => header.toLowerCase());