]> PHS Git Server - phs-admin.git/commitdiff
Adding .truncate to @lodash.js.
authorcharleswrayjr <charleswrayjr@gmail.com>
Sat, 13 Sep 2025 15:59:24 +0000 (10:59 -0500)
committercharleswrayjr <charleswrayjr@gmail.com>
Sat, 13 Sep 2025 15:59:24 +0000 (10:59 -0500)
src/@lodash/@lodash.js

index 76b71db5508677b087400e7a0ff4d3b644b5902c..46ea8a6e3ff4e0548d0502c414444224d8df4b3e 100755 (executable)
@@ -8,6 +8,9 @@ import __ from 'lodash';
 const _ = __.runInContext();
 
 _.mixin({
+  truncateString: (str, maxLength) => {
+    return _.truncate(str, { length: maxLength, omission: '...' });
+  },
   // Immutable Set for setting state
   setIn: (state, name, value) => {
     return _.setWith(_.clone(state), name, value, _.clone);