• resolve the positive (normalized) starting and ending indexes of a range.
    for both start and end, a negative index can be used to indicate an index from the end of the range, if a length is given.
    for example, -2 refers to the second to last index (ie length - 2).

    Parameters

    • start: undefined | number

      starting index. defaults to 0

    • end: undefined | number

      ending index. defaults to undefined if length is not provided. else end = length (before offsetting)

    • length: number

      length of the array in question. required if you want a numeric value of end that is undefined. defaults to undefined

    • Optionaloffset: number

      in the very end of evauation, add an addition offset to start and end indexes

    Returns [start: number, end: number, length: number]

    a 3-tuple array of resolved [start index, end index, and length of range (ie end - start)]

  • Parameters

    • Optionalstart: number
    • Optionalend: number
    • Optionallength: undefined
    • Optionaloffset: number

    Returns [start: number, end: number | undefined, length: undefined]