UNPKG

@hoosei/voxweave-react

Version:

A customizable and interactive voice UI component for React applications

43 lines (42 loc) 1.13 kB
var g = "!"; function I(o) { var r = o.separator || ":", i = r.length === 1, s = r[0], f = r.length; return function(a) { for (var v = [], h = 0, e = 0, n, t = 0; t < a.length; t++) { var p = a[t]; if (h === 0) { if (p === s && (i || a.slice(t, t + f) === r)) { v.push(a.slice(e, t)), e = t + f; continue; } if (p === "/") { n = t; continue; } } p === "[" ? h++ : p === "]" && h--; } var u = v.length === 0 ? a : a.substring(e), M = u.startsWith(g), l = M ? u.substring(1) : u, b = n && n > e ? n - e : void 0; return { modifiers: v, hasImportantModifier: M, baseClassName: l, maybePostfixModifierPosition: b }; }; } function P(o) { if (o.length <= 1) return o; var r = [], i = []; return o.forEach(function(s) { var f = s[0] === "["; f ? (r.push.apply(r, i.sort().concat([s])), i = []) : i.push(s); }), r.push.apply(r, i.sort()), r; } export { g as IMPORTANT_MODIFIER, I as createSplitModifiers, P as sortModifiers }; //# sourceMappingURL=index74.js.map