Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TypeScript to 5.4.3 #246

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"lint-staged": "^13.2.1",
"mocha": "^10.2.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
"typescript": "^5.4.3"
},
"lint-staged": {
"*.js": [
Expand Down
6 changes: 5 additions & 1 deletion src/AbstractSQLCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
SqlResult,
} from './AbstractSQLRules2SQL';
export { Binding, SqlResult } from './AbstractSQLRules2SQL';
import type { SbvrType } from '@balena/sbvr-types';
import sbvrTypes from '@balena/sbvr-types';
import * as _ from 'lodash';
import { optimizeSchema } from './AbstractSQLSchemaOptimiser';
Expand Down Expand Up @@ -574,7 +575,10 @@ const dataTypeValidate: EngineInstance['dataTypeValidate'] = async (
) => {
// In case one of the validation types throws an error.
const { dataType, required = false } = field;
const validateFn = validateTypes[dataType as keyof typeof sbvrTypes];
// Without the `: SbvrType['validate']` widening TS complains that
// "none of those signatures are compatible with each other".
const validateFn: SbvrType['validate'] =
validateTypes[dataType as keyof typeof sbvrTypes];
if (validateFn != null) {
return validateFn(value, required);
} else {
Expand Down
Loading