core: fix sortable handle

This commit is contained in:
undefined committed 2021-11-29 22:56:03 +08:00
1 parent 4918f41eac
commit 51527c7f79
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -22,7 +22,7 @@ export interface ProblemDoc extends Document { }
export type Field = keyof ProblemDoc;
function sortable(source: string) {
return source.replace(/(\d+)/g, (str) => '0'.repeat(6 - str.length) + str);
return source.replace(/(\d+)/g, (str) => (str.length >= 6 ? str : ('0'.repeat(6 - str.length) + str)));
}
export class ProblemModel {