Function validateNumList

Returns an array of numbers from the given list.

If it returns without throwing, the input is necessarily valid. If the result is an empty array, it will return null.

LisnUsageError If the input is not a number or array of numbers. Numerical strings are accepted.

  • Parameters

    • key: string

      Used in the error message thrown

    • value: unknown

    Returns undefined | number[]

    undefined if the input contains no non-empty values (after trimming whitespace on left/right from each), otherwise a non-empty array of values.