17 lines
405 B
JavaScript
17 lines
405 B
JavaScript
function r(u, i, o) {
|
|
const h = i, s = o || i;
|
|
return function(e) {
|
|
const n = [], l = e.matchAll(u);
|
|
let t = 0;
|
|
for (const c of l) {
|
|
const f = e.slice(t, c.index);
|
|
f && n.push(s(f, !1)), n.push(h(c[0], !0)), t = c.index + c[0].length;
|
|
}
|
|
return t < e.length && n.push(s(e.slice(t), !1)), n;
|
|
};
|
|
}
|
|
export {
|
|
r as stringTokenizer
|
|
};
|
|
//# sourceMappingURL=index.es.js.map
|