fix: issues that comes out when using TypeScript >= 4.8 (#386)

This commit is contained in:
Ihor Halchevskyi 2022-11-16 02:58:33 -05:00 committed by GitHub
parent bb38270b97
commit 9743dc1bdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 9 deletions

14
package-lock.json generated
View File

@ -31,7 +31,7 @@
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typeorm": "^0.3.10",
"typescript": "^4.8.4"
"typescript": "^4.9.3"
},
"peerDependencies": {
"@nestjs/common": "^9.2.0",
@ -7023,9 +7023,9 @@
}
},
"node_modules/typescript": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"version": "4.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.3.tgz",
"integrity": "sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@ -12602,9 +12602,9 @@
}
},
"typescript": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"version": "4.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.3.tgz",
"integrity": "sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==",
"dev": true
},
"unique-filename": {

View File

@ -49,7 +49,7 @@
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typeorm": "^0.3.10",
"typescript": "^4.8.4"
"typescript": "^4.9.3"
},
"dependencies": {
"lodash": "^4.17.21"

View File

@ -14,6 +14,7 @@ import {
Brackets,
Between,
FindOptionsWhere,
ObjectLiteral,
} from 'typeorm'
import { PaginateQuery } from './decorator'
import { ServiceUnavailableException, Logger } from '@nestjs/common'
@ -170,7 +171,7 @@ function parseFilter<T>(query: PaginateQuery, config: PaginateConfig<T>) {
return filter
}
export async function paginate<T>(
export async function paginate<T extends ObjectLiteral>(
query: PaginateQuery,
repo: Repository<T> | SelectQueryBuilder<T>,
config: PaginateConfig<T>