diff --git a/packages/hydrooj/src/model/problem.ts b/packages/hydrooj/src/model/problem.ts index 42754ef3e..6d71d6c74 100644 --- a/packages/hydrooj/src/model/problem.ts +++ b/packages/hydrooj/src/model/problem.ts @@ -33,7 +33,7 @@ export interface ProblemDoc extends Document { } export type Field = keyof ProblemDoc; const logger = new Logger('problem'); -function sortable(source: string, namespaces: Record = {}) { +function sortable(source: string, namespaces: Record) { const [namespace, pid] = source.includes('-') ? source.split('-') : ['default', source]; return ((namespaces ? `${namespaces[namespace]}-` : '') + pid) .replace(/(\d+)/g, (str) => (str.length >= 6 ? str : ('0'.repeat(6 - str.length) + str)));