1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

refactor: ts improvements

This commit is contained in:
2022-05-07 09:46:07 +02:00
parent e4c5d9b404
commit 5cb8ec65ad
5 changed files with 20 additions and 11 deletions

View File

@ -17,7 +17,7 @@ export class SQLiteClient extends AntaresCore {
this._connectionsToCommit = new Map();
}
_getTypeInfo (type: string) {
getTypeInfo (type: string): antares.TypeInformations {
return dataTypes
.reduce((acc, group) => [...acc, ...group.types], [])
.filter(_type => _type.name === type.toUpperCase())[0];
@ -298,7 +298,7 @@ export class SQLiteClient extends AntaresCore {
// ADD FIELDS
fields.forEach(field => {
const typeInfo = this._getTypeInfo(field.type);
const typeInfo = this.getTypeInfo(field.type);
const length = typeInfo?.length ? field.enumValues || field.numLength || field.charLength || field.datePrecision : false;
newColumns.push(`"${field.name}"