Created
December 17, 2020 15:11
-
-
Save wesleybliss/92709563e8e0bbcbab854c20dde21525 to your computer and use it in GitHub Desktop.
Snippet ellipsis #js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const snippet = (val, len = 5) => | |
(val && val.length > (len * 2)) | |
? val.substring(0, len) + '...' + val.substring(val.length - len) | |
: val |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment