Untitled

 avatar
unknown
plain_text
4 years ago
660 B
6
Indexable
      // Truncate long values
          const maxHeaderChars = 14
          const maxValueChars = 24
          const headerClipped =
            headerValues[index].length > maxHeaderChars
              ? headerValues[index].slice(0, maxHeaderChars) + '...'
              : headerValues[index]
          const valueClipped =
            headerValues[index] !== 'LinkedinHandle' &&
            value.length > maxValueChars
              ? value.slice(0, maxValueChars) + '...'
              : value

    // Convert each row from an array, to an object where properties are the headers (for prettier printing)
    return { ...acc, [headerClipped]: valueClipped }
Editor is loading...