Skip to content

Commit dd8139d

Browse files
committed
Changed typsescript version to 5 and implemented suggested changes to config.ts
1 parent 8cce52a commit dd8139d

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

api/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"prettier": "^3",
7272
"supertest": "^7",
7373
"ts-jest": "^29",
74-
"typescript": "^6",
74+
"typescript": "^5",
7575
"typescript-eslint": "^8.52"
7676
}
7777
}

api/src/models/Config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Config {
3737
}
3838

3939
get backendUrl(): string {
40-
return (this.ini["backend_url"] as string) ?? "http://localhost:9000";
40+
return (this.ini["backend_url"] ?? "http://localhost:9000") as string;
4141
}
4242

4343
get clientUrl(): string {
@@ -114,7 +114,7 @@ class Config {
114114
}
115115

116116
get tikaConfigFile(): string | null {
117-
return (this.ini["tika_config_file"] as string) ?? null;
117+
return (this.ini["tika_config_file"] ?? null) as string | null;
118118
}
119119

120120
get tikaPath(): string {
@@ -207,7 +207,7 @@ class Config {
207207
}
208208

209209
get models(): Record<string, FedoraModel> {
210-
return (this.ini["models"] as unknown as Record<string, FedoraModel>) || {};
210+
return (this.ini["models"] as Record<string, FedoraModel>) || {};
211211
}
212212

213213
get databaseSettings(): ConfigRecord {
@@ -267,7 +267,7 @@ class Config {
267267
}
268268

269269
get agentDefaults(): Record<string, string> {
270-
return ((this.ini["agent"] as ConfigRecord)?.["defaults"] as Record<string, string>) ?? {};
270+
return ((this.ini["agent"] as ConfigRecord | undefined)?.["defaults"] as Record<string, string>) ?? {};
271271
}
272272

273273
get agentRoles(): Array<string> {

0 commit comments

Comments
 (0)