使用export = 替换export default

This commit is contained in:
undefined committed 2020-08-21 20:07:23 +08:00
1 parent 12af2f7542
commit c63643d349
15 files changed
+38 -25

No files matched your search

+3 -1
View File
@@ -1,7 +1,7 @@
import { Cursor } from 'mongodb';
import { ValidationError } from '../error';
export default async function paginate(
async function paginate(
cursor: Cursor, page: number, pageSize: number,
): Promise<[any[]/* docs */, number/* numPages */, number/* count */]> {
if (page <= 0) throw new ValidationError('page');
@@ -13,4 +13,6 @@ export default async function paginate(
return [pageDocs, numPages, count];
}
export = paginate;
global.Hydro.lib.paginate = paginate;