Untitled
Anonymous
plain_text
12/13/2021 9:37 PM
880 B
19
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...