Skip to content

Commit

Permalink
feat: add support for parsing comma-separated list environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
fnesveda committed Dec 5, 2024
1 parent 691ba99 commit 60484a3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/core/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ export class Configuration {

protected static INTEGER_VARS = ['memoryMbytes', 'persistStateIntervalMillis', 'systemInfoIntervalMillis'];

protected static COMMA_SEPARATED_LIST_VARS: string[] = [];

protected static DEFAULTS: Dictionary = {
defaultKeyValueStoreId: 'default',
defaultDatasetId: 'default',
Expand Down Expand Up @@ -344,6 +346,10 @@ export class Configuration {
return !['0', 'false', ''].includes(String(value).toLowerCase());
}

if (Configuration.COMMA_SEPARATED_LIST_VARS.includes(key)) {
return String(value).split(',').map((v) => v.trim());
}

return value;
}

Expand Down

0 comments on commit 60484a3

Please sign in to comment.