@scolastico-dev/env-helper
    Preparing search index...

    Function $oneOf

    • Retrieves a string value from an environment variable and validates it's one of the allowed values.

      Parameters

      • key: string

        The name of the environment variable

      • values: string[]

        Array of allowed string values

      • Optionaldef: string

        Optional default string value to use if the environment variable is not set

      Returns string

      The string value from the environment variable if it's in the allowed values list

      Will throw an error if the value is not in the allowed values list, or if the environment variable is missing and no default is provided