You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polaris.apache.org by jb...@apache.org on 2026/02/25 17:41:47 UTC
(polaris-tools) branch main updated: fix: fix typing issue (#177)
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris-tools.git
The following commit(s) were added to refs/heads/main by this push:
new bee7b14 fix: fix typing issue (#177)
bee7b14 is described below
commit bee7b14c1ad791070c668ffea119f8789d74c6b6
Author: Artur Rakhmatulin <ar...@gmail.com>
AuthorDate: Wed Feb 25 17:41:42 2026 +0000
fix: fix typing issue (#177)
---
console/src/lib/config.ts | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/console/src/lib/config.ts b/console/src/lib/config.ts
index b2e9498..df86637 100644
--- a/console/src/lib/config.ts
+++ b/console/src/lib/config.ts
@@ -35,21 +35,18 @@ declare global {
}
}
-function getConfig<T extends string | undefined>(key: keyof AppConfig, defaultValue?: T): T {
- // First try runtime config
+function getConfig(key: keyof AppConfig, defaultValue: string = ""): string {
const runtimeValue = window.APP_CONFIG?.[key]
if (runtimeValue !== undefined && runtimeValue !== "") {
- return runtimeValue as T
+ return runtimeValue
}
- // Then try build-time config
const buildTimeValue = import.meta.env[key]
if (buildTimeValue !== undefined && buildTimeValue !== "") {
- return buildTimeValue as T
+ return buildTimeValue
}
- // Finally use default
- return defaultValue as T
+ return defaultValue
}
export const config = {