fix: issues that comes out when using TypeScript >= 4.8 (#386)
This commit is contained in:
parent
bb38270b97
commit
9743dc1bdd
14
package-lock.json
generated
14
package-lock.json
generated
@ -31,7 +31,7 @@
|
|||||||
"ts-jest": "^29.0.3",
|
"ts-jest": "^29.0.3",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typeorm": "^0.3.10",
|
"typeorm": "^0.3.10",
|
||||||
"typescript": "^4.8.4"
|
"typescript": "^4.9.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@nestjs/common": "^9.2.0",
|
"@nestjs/common": "^9.2.0",
|
||||||
@ -7023,9 +7023,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "4.8.4",
|
"version": "4.9.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.3.tgz",
|
||||||
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
|
"integrity": "sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
@ -12602,9 +12602,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "4.8.4",
|
"version": "4.9.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.3.tgz",
|
||||||
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
|
"integrity": "sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"unique-filename": {
|
"unique-filename": {
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
"ts-jest": "^29.0.3",
|
"ts-jest": "^29.0.3",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typeorm": "^0.3.10",
|
"typeorm": "^0.3.10",
|
||||||
"typescript": "^4.8.4"
|
"typescript": "^4.9.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lodash": "^4.17.21"
|
"lodash": "^4.17.21"
|
||||||
|
@ -14,6 +14,7 @@ import {
|
|||||||
Brackets,
|
Brackets,
|
||||||
Between,
|
Between,
|
||||||
FindOptionsWhere,
|
FindOptionsWhere,
|
||||||
|
ObjectLiteral,
|
||||||
} from 'typeorm'
|
} from 'typeorm'
|
||||||
import { PaginateQuery } from './decorator'
|
import { PaginateQuery } from './decorator'
|
||||||
import { ServiceUnavailableException, Logger } from '@nestjs/common'
|
import { ServiceUnavailableException, Logger } from '@nestjs/common'
|
||||||
@ -170,7 +171,7 @@ function parseFilter<T>(query: PaginateQuery, config: PaginateConfig<T>) {
|
|||||||
return filter
|
return filter
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function paginate<T>(
|
export async function paginate<T extends ObjectLiteral>(
|
||||||
query: PaginateQuery,
|
query: PaginateQuery,
|
||||||
repo: Repository<T> | SelectQueryBuilder<T>,
|
repo: Repository<T> | SelectQueryBuilder<T>,
|
||||||
config: PaginateConfig<T>
|
config: PaginateConfig<T>
|
||||||
|
Loading…
Reference in New Issue
Block a user