From d1be5b5f559029469e9a6e8eade918f649291143 Mon Sep 17 00:00:00 2001 From: Evan Shortiss Date: Thu, 28 Oct 2021 20:11:53 +0100 Subject: [PATCH] feat: support readonly enum types (#149) --- env-var.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/env-var.d.ts b/env-var.d.ts index b9bf31b..396b22f 100644 --- a/env-var.d.ts +++ b/env-var.d.ts @@ -101,7 +101,7 @@ type PublicAccessors = { /** * Verifies that the var being accessed is one of the given values */ - asEnum: (input: string, validValues: T[]) => T; + asEnum: (input: string, validValues: readonly T[]|T[]) => T; } interface VariableAccessors { @@ -201,7 +201,7 @@ interface VariableAccessors { /** * Verifies that the var being accessed is one of the given values */ - asEnum: (validValues: T[]) => AlternateType extends undefined ? undefined|T : T; + asEnum: (validValues: readonly T[]|T[]) => AlternateType extends undefined ? undefined|T : T; /** * Verifies that the variable is a valid regular expression and returns the