Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/range"

Index

Functions

numRange

  • numRange(start: number, end: number): number[]
  • Returns a range of numerical values given numbers

    Parameters

    • start: number
    • end: number

    Returns number[]

range

  • range(start: string | number, end: string | number): number[] | string[]
  • Uses utf8Range and numRange to return a range.

    Example

    let numbers: number[] = range(1, 5); // [1, 2, 3, 4, 5]
    let reverse: number[] = range(5, 1); // [5, 4, 3, 2, 1]
    let letters: string[] = range("a", "d"); // ["a", "b", "c", "d"]
    let reverseL: string[] = range("d", "a"); // ["d", "c", "b", "a"]
    

    Parameters

    • start: string | number
    • end: string | number

    Returns number[] | string[]

utf8Range

  • utf8Range(start: string | number, end: string | number): string[]
  • Returns a range of utf8 characters based on position in utf8 range

    Parameters

    • start: string | number
    • end: string | number

    Returns string[]

Generated using TypeDoc