@orchestrator-ui/orchestrator-ui-components
Version:
Library of UI Components used to display the workflow orchestrator frontend
13 lines (10 loc) • 326 B
text/typescript
export const getNumberValueFromEnvironmentVariable = (
environmentVariable: string | undefined,
defaultValue: number,
) => {
if (!environmentVariable) {
return defaultValue;
}
const valueAsNumber = parseInt(environmentVariable);
return isNaN(valueAsNumber) ? defaultValue : valueAsNumber;
};