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

    Function $range

    • Retrieves a number from an environment variable and validates it's within a specified range.

      Parameters

      • value: string

        The name of the environment variable

      • min: number

        The minimum allowed value (inclusive)

      • max: number

        The maximum allowed value (inclusive)

      • Optionaldef: number

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

      Returns number

      The number value from the environment variable if it's within the specified range

      Will throw an error if the value is not a valid number, is outside the range, or if the environment variable is missing and no default is provided