Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/hydrooj/src/handler/training.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'assert';
import { escapeRegExp, pick } from 'lodash';
import { escapeRegExp, isNumber, pick } from 'lodash';
import { Filter, ObjectId } from 'mongodb';
import { sortFiles } from '@hydrooj/utils/lib/utils';
import {
Expand All @@ -26,7 +26,7 @@ async function _parseDagJson(domainId: string, _dag: string): Promise<Tdoc['dag'
assert(dag.length, 'must have at least one node');
assert(dag.length === ids.size, '_id must be unique');
for (const node of dag) {
assert(node._id, 'each node should have a _id');
assert(isNumber(node._id), '_id should be a number');
assert(node.title, 'each node shoule have a title');
assert(node.requireNids instanceof Array);
assert(node.pids instanceof Array);
Expand Down
Loading