Skip to content
Snippets Groups Projects
Verified Commit 3a905c17 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

feat(transformer): new command ellipsize

parent 0e5ff7cd
No related branches found
No related tags found
No related merge requests found
...@@ -515,6 +515,19 @@ function transform(value) { ...@@ -515,6 +515,19 @@ function transform(value) {
return pf.getVia(key); return pf.getVia(key);
case 'ellipsize':
case 'ellipsis':
case 'ellipse':
validateString(value);
const length = parseInt(args[0]) || 0;
const ellipsis = args[1] || '';
if (value.length <= length) {
return value;
}
return value.substring(0, length) + ellipsis;
case "substring": case "substring":
validateString(value); validateString(value);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment