Skip to content

Commit

Permalink
feat: support readonly enum types (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
evanshortiss authored Oct 28, 2021
1 parent 68b4db1 commit d1be5b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions env-var.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ type PublicAccessors = {
/**
* Verifies that the var being accessed is one of the given values
*/
asEnum: <T extends string>(input: string, validValues: T[]) => T;
asEnum: <T extends string>(input: string, validValues: readonly T[]|T[]) => T;
}

interface VariableAccessors <AlternateType = unknown> {
Expand Down Expand Up @@ -201,7 +201,7 @@ interface VariableAccessors <AlternateType = unknown> {
/**
* Verifies that the var being accessed is one of the given values
*/
asEnum: <T extends string>(validValues: T[]) => AlternateType extends undefined ? undefined|T : T;
asEnum: <T extends string>(validValues: readonly T[]|T[]) => AlternateType extends undefined ? undefined|T : T;

/**
* Verifies that the variable is a valid regular expression and returns the
Expand Down

0 comments on commit d1be5b5

Please sign in to comment.