This commit is contained in:
tamaina
2023-02-12 12:20:19 +00:00
parent 7eb9cbb4a6
commit 199b247e85
30 changed files with 639 additions and 2 deletions

13
built/utils/clip.js Normal file
View File

@ -0,0 +1,13 @@
import nullOrEmpty from './null-or-empty.js';
export default function (s, max) {
if (nullOrEmpty(s)) {
return s;
}
s = s.trim();
if (s.length > max) {
return s.substr(0, max) + '...';
}
else {
return s;
}
}