@corefunc/corefunc
    Preparing search index...

    Function textFitLength

    • Parameters

      • Optionaltext: string

        Text to fit.

      • Optionallength: number = 99

        Length in character count, not string length.

      • OptionaladdEllipsis: boolean = true

        Add ellipsis if text was cut.

      Returns string

      New text.

      textFitLength

      Trim and fit text to length

      textFitLength("Hello, world!", 6) // ➜ "Hello…"
      

      0.1.69