As you have this nice fromEnv Helper: https://github.com/NordicSemiconductor/asset-tracker-cloud-aws-js/blob/e160d890ffdc7096ff54dfbc8c25dbe68a660675/util/fromEnv.ts#L1 I thought you may like the idea of typing environment variables as well (following the snake uppercase convention for env params) export type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Capitalize<T> ? "_" : ""}${Lowercase<T>}${CamelToSnakeCase<U>}` : S; export type EnvParameters<Type extends Record<string, string>> = Record< `${Uppercase<CamelToSnakeCase<Extract<keyof Type, string>>>}`, string >; Example: export type WebhookEnvironmentVariables = { webhookSecret: string; eventQueueName: string; }; const envParams: EnvParameters<WebhookEnvironmentVariables> will result in a type { WEBHOOK_SECRET: string; EVENT_QUEUE_NAME: string; }
As you have this nice fromEnv Helper:
asset-tracker-cloud-aws-js/util/fromEnv.ts
Line 1 in e160d89
I thought you may like the idea of typing environment variables as well (following the snake uppercase convention for env params)
Example:
will result in a type