Function wrap

  • Wraps a string to a given size.

    Parameters

    • string: string

      The string to be wrapped.

    • width: number

      The desired width of each line.

    • Optional sizer: Sizer

      Sizer for respecting unrendered characters.

    Returns string[]

  • Wraps a string to a given size.

    Parameters

    Returns string[]

    The lines of the wrapped string in an array.