Merge branch 'main' into new-admin
This commit is contained in:
commit
781cbca94e
3 changed files with 399 additions and 387 deletions
|
@ -70,9 +70,9 @@
|
||||||
"@types/glob": "^7.2.0",
|
"@types/glob": "^7.2.0",
|
||||||
"@types/graceful-fs": "^4.1.5",
|
"@types/graceful-fs": "^4.1.5",
|
||||||
"@types/html-to-text": "^8.1.1",
|
"@types/html-to-text": "^8.1.1",
|
||||||
"@types/jest": "^28.1.8",
|
"@types/jest": "^29.0.0",
|
||||||
"@types/lodash": "^4.14.184",
|
"@types/lodash": "^4.14.184",
|
||||||
"@types/node": "^18.7.13",
|
"@types/node": "^18.7.14",
|
||||||
"@types/node-cron": "^3.0.2",
|
"@types/node-cron": "^3.0.2",
|
||||||
"@types/nodemailer": "^6.4.5",
|
"@types/nodemailer": "^6.4.5",
|
||||||
"@types/request": "^2.48.8",
|
"@types/request": "^2.48.8",
|
||||||
|
@ -102,13 +102,13 @@
|
||||||
"grunt-rev": "^0.1.0",
|
"grunt-rev": "^0.1.0",
|
||||||
"grunt-usemin": "^3.1.1",
|
"grunt-usemin": "^3.1.1",
|
||||||
"grunt-wiredep": "^3.0.1",
|
"grunt-wiredep": "^3.0.1",
|
||||||
"jest": "^28.1.3",
|
"jest": "^29.0.1",
|
||||||
"jshint-stylish": "^2.2.1",
|
"jshint-stylish": "^2.2.1",
|
||||||
"load-grunt-tasks": "^5.1.0",
|
"load-grunt-tasks": "^5.1.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"time-grunt": "^2.0.0",
|
"time-grunt": "^2.0.0",
|
||||||
"ts-jest": "^28.0.8",
|
"ts-jest": "^28.0.8",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.8.2",
|
||||||
"yarn-audit-fix": "^9.3.5"
|
"yarn-audit-fix": "^9.3.5"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
|
|
|
@ -144,7 +144,9 @@ export function toIsArray<T>(isT: TypeGuard<T>): TypeGuard<T[]> {
|
||||||
return (arg): arg is T[] => isArray(arg, isT);
|
return (arg): arg is T[] => isArray(arg, isT);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function toIsEnum<E>(enumDef: E): EnumTypeGuard<E> {
|
export function toIsEnum<E extends Record<keyof E, ValueOf<E>>>(
|
||||||
|
enumDef: E
|
||||||
|
): EnumTypeGuard<E> {
|
||||||
return (arg): arg is ValueOf<E> =>
|
return (arg): arg is ValueOf<E> =>
|
||||||
Object.values(enumDef).includes(arg as [keyof E]);
|
Object.values(enumDef).includes(arg as [keyof E]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue