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 { pick } from 'lodash';
import {
ContestNotFoundError, PermissionError, ProblemNotFoundError,
RecordNotFoundError, UserNotFoundError,
} from '../error';
import { buildProjection } from '../utils';
import { RecordDoc } from '../interface';
import { PERM, STATUS, PRIV } from '../model/builtin';
import * as system from '../model/system';
@@ -17,7 +17,6 @@ import * as bus from '../service/bus';
import {
Route, Handler, Connection, ConnectionHandler, Types, param,
} from '../service/server';
import { buildProjection } from '../utils';
class RecordListHandler extends Handler {
@param('page', Types.PositiveInt, true)
@@ -60,7 +59,7 @@ class RecordListHandler extends Handler {
user.getList(domainId, rdocs.map((rdoc) => rdoc.uid)),
canViewProblem
? 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)
: 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 f = ddocs.filter((i) => !(
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 (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 fs from 'fs-extra';
import os from 'os';
import { Duplex, Readable } from 'stream';
import { Duplex } from 'stream';
import { ObjectID } from 'mongodb';
import { isMoment } from 'moment';
import type { Moment } from 'moment-timezone';
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/utils",
"version": "1.0.17",
"version": "1.0.18",
"description": "hydrooj utils",
"main": "package.json",
"repository": "https://github.com/hydro-dev/Hydro.git",