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

    Function $max

    • Retrieves a number from an environment variable and validates it doesn't exceed a maximum value.

      Parameters

      • value: string

        The name of the environment variable

      • max: number

        The maximum allowed value

      • 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 maximum limit

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