Helper method for limiting the number of characters shown on screen.
(str, limit = 50)
| 161 | |
| 162 | /** Helper method for limiting the number of characters shown on screen. */ |
| 163 | function limitStringToLength(str, limit = 50) { |
| 164 | if (str.length <= limit) { |
| 165 | return str; |
| 166 | } else { |
| 167 | return `...${str.slice(str.length - limit)}`; |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * Create and material-design card for a search match and add |