Guest User

Untitled

a guest
Jun 17th, 2020
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             {
  2.                 key: "splitTextV1",
  3.                 value: function(t, e, n) {
  4.                     var r = [];
  5.                     !function t(o, i) {
  6.                         if (e[i] && o.trim().length)
  7.                             if (o.indexOf(e[i]) > -1) {
  8.                                 var a = 1
  9.                                   , s = o.split(e[i]);
  10.                                 s.forEach((function(o) {
  11.                                     if (o.length) {
  12.                                         var c = "";
  13.                                         a !== s.length && (c = e[i]),
  14.                                         o = (o + c).trim()
  15.                                     }
  16.                                     o.length && o.length <= n ? r.push(o) : t(o, i + 1),
  17.                                     a++
  18.                                 }
  19.                                 ))
  20.                             } else
  21.                                 t(o, i + 1);
  22.                         else if (o.length)
  23.                             for (var c = new RegExp(".{1,".concat(n, "}"),"g"), u = o.match(c); u.length > 0; )
  24.                                 r.push(u.shift().trim())
  25.                     }(t, 0);
  26.                     var o = [];
  27.                     return r.forEach((function(t) {
  28.                         o.length && o[o.length - 1].length + t.length + 1 <= n ? o[o.length - 1] += " ".concat(t) : o.push(t)
  29.                     }
  30.                     )),
  31.                     o
  32.                 }
  33.             }
Advertisement
Add Comment
Please, Sign In to add comment