4 Matching Annotations
  1. Nov 2021
    1. Determine if the string's length is greater than num. Return the string truncated to the desired length, with '...' appended to the end of the original string. Copyconst ellipsis = (str: string, num: number = str.length, ellipsisStr = "...") => str.length >= num ? str.slice(0, num >= ellipsisStr.length ? num - ellipsisStr.length : num) + ellipsisStr : str;