UNPKG

lakutata

Version:

An IoC-based universal application framework.

41 lines (30 loc) 947 B
/* Build Date: Mon Jan 05 2026 23:52:23 GMT+0800 (China Standard Time) */ function e(e, t) { return p(e, t).map(a(t?.locale)).join(" "); } const t = /([\p{Ll}\d])(\p{Lu})/gu; const r = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu; const l = /(\d)(\p{Ll})/gu; const c = /(\p{L})(\d)/gu; const n = /[^\p{L}\d]+/giu; const o = "$1\0$2"; function p(e, p) { let a = e.replace(t, o).replace(r, o); if (p && p.separateNumbers) { a = a.replace(l, o).replace(c, o); } a = a.replace(n, "\0"); let u = 0; let s = a.length; while (a.charAt(u) === "\0") u++; if (u === s) return []; while (a.charAt(s - 1) === "\0") s--; return a.slice(u, s).split(/\0/g); } function a(e) { return e === false ? e => e.toLowerCase() : t => t.toLocaleLowerCase(e); } function u(e) { return e === false ? e => e.toUpperCase() : t => t.toLocaleUpperCase(e); } export { e as NoCase, p as Split, a as ToLower, u as ToUpper };