remove unused vars

This commit is contained in:
undefined committed 2021-05-28 22:19:51 +08:00
1 parent 9151fc9f66
commit be2b1c5524
4 files changed
+5 -6

No files matched your search

+2 -3
View File
@@ -1,9 +1,9 @@
import { FilterQuery, ObjectID } from 'mongodb'; import { FilterQuery, ObjectID } from 'mongodb';
import { pick } from 'lodash';
import { import {
ContestNotFoundError, PermissionError, ProblemNotFoundError, ContestNotFoundError, PermissionError, ProblemNotFoundError,
RecordNotFoundError, UserNotFoundError, RecordNotFoundError, UserNotFoundError,
} from '../error'; } from '../error';
import { buildProjection } from '../utils';
import { RecordDoc } from '../interface'; import { RecordDoc } from '../interface';
import { PERM, STATUS, PRIV } from '../model/builtin'; import { PERM, STATUS, PRIV } from '../model/builtin';
import * as system from '../model/system'; import * as system from '../model/system';
@@ -17,7 +17,6 @@ import * as bus from '../service/bus';
import { import {
Route, Handler, Connection, ConnectionHandler, Types, param, Route, Handler, Connection, ConnectionHandler, Types, param,
} from '../service/server'; } from '../service/server';
import { buildProjection } from '../utils';
class RecordListHandler extends Handler { class RecordListHandler extends Handler {
@param('page', Types.PositiveInt, true) @param('page', Types.PositiveInt, true)
@@ -60,7 +59,7 @@ class RecordListHandler extends Handler {
user.getList(domainId, rdocs.map((rdoc) => rdoc.uid)), user.getList(domainId, rdocs.map((rdoc) => rdoc.uid)),
canViewProblem canViewProblem
? problem.getList(domainId, rdocs.map( ? problem.getList(domainId, rdocs.map(
(rdoc) => (rdoc.domainId === domainId ? rdoc.pid : `${rdoc.pdomain}:${rdoc.pid}`) (rdoc) => (rdoc.domainId === domainId ? rdoc.pid : `${rdoc.pdomain}:${rdoc.pid}`),
), canViewProblemHidden, false) ), canViewProblemHidden, false)
: Object.fromEntries([rdocs.map((rdoc) => [rdoc.pid, { ...problem.default, pid: rdoc.pid }])]), : Object.fromEntries([rdocs.map((rdoc) => [rdoc.pid, { ...problem.default, pid: rdoc.pid }])]),
]); ]);
+1 -1
View File
@@ -248,7 +248,7 @@ export class ProblemModel {
const ddocs = await Promise.all(Object.keys(parsed).map((i) => domain.get(i))); const ddocs = await Promise.all(Object.keys(parsed).map((i) => domain.get(i)));
const f = ddocs.filter((i) => !( const f = ddocs.filter((i) => !(
i.share === '*' i.share === '*'
|| (`,${i.share.replace(/,/g, ',').split(',').map((i) => i.trim()).join(',')},`).includes(`,${domainId},`) || (`,${i.share.replace(/,/g, ',').split(',').map((q) => q.trim()).join(',')},`).includes(`,${domainId},`)
)); ));
if (f.length) { if (f.length) {
if (doThrow) throw new ProblemNotFoundError(f[0]._id, parsed[f[0]._id][0].pid); if (doThrow) throw new ProblemNotFoundError(f[0]._id, parsed[f[0]._id][0].pid);
+1 -1
View File
@@ -1,7 +1,7 @@
import path from 'path'; import path from 'path';
import fs from 'fs-extra'; import fs from 'fs-extra';
import os from 'os'; import os from 'os';
import { Duplex, Readable } from 'stream'; import { Duplex } from 'stream';
import { ObjectID } from 'mongodb'; import { ObjectID } from 'mongodb';
import { isMoment } from 'moment'; import { isMoment } from 'moment';
import type { Moment } from 'moment-timezone'; import type { Moment } from 'moment-timezone';
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/utils", "name": "@hydrooj/utils",
"version": "1.0.17", "version": "1.0.18",
"description": "hydrooj utils", "description": "hydrooj utils",
"main": "package.json", "main": "package.json",
"repository": "https://github.com/hydro-dev/Hydro.git", "repository": "https://github.com/hydro-dev/Hydro.git",