Skip to content

Commit

Permalink
tiny changes
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesNg35 committed Dec 11, 2023
1 parent ca5aa6b commit e4df6d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/web/app/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ type ReturnedType<T> = {
readonly value: T extends string ? string : InferValue<T>;
};

/**
* This function loads only env variables which start with NEXT_PUBLIC_*
*
* Usefull to get the latest value of variable at runtime instead of buildtime

Check warning on line 20 in apps/web/app/env.ts

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (Usefull)

Check warning on line 20 in apps/web/app/env.ts

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (buildtime)
*
* @param name
* @param options
* @returns
*/
export function getNextPublicEnv<O extends Options<unknown>>(name: string, options?: O): ReturnedType<O> {
return {
get value() {
Expand Down

0 comments on commit e4df6d2

Please sign in to comment.