@tempots/std
Version:
Std library for TypeScript. Natural complement to the Tempo libraries.
15 lines (14 loc) • 434 B
JavaScript
const h = (n, i, u) => {
const e = [];
let s = 0, l;
if (i.global)
for (i.lastIndex = 0; (l = i.exec(n)) !== null; )
e.push(n.substring(s, l.index)), e.push(u(...l)), s = l.index + l[0].length;
else
for (; (l = i.exec(n.substring(s))) !== null; )
e.push(n.substring(s, s + l.index)), e.push(u(...l)), s += l.index + l[0].length;
return e.push(n.substring(s)), e.join("");
};
export {
h as mapRegExp
};