ez-common-ts/lib/index.es.js

17 lines
405 B
JavaScript
Raw Normal View History

2023-11-10 16:35:59 +08:00
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