UNPKG

@tempots/std

Version:

Std library for TypeScript. Natural complement to the Tempo libraries.

2 lines (1 loc) 445 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=(s,n,i)=>{const l=[];let g=0,e;if(n.global)for(n.lastIndex=0;(e=n.exec(s))!==null;)l.push(s.substring(g,e.index)),l.push(i(...e)),g=e.index+e[0].length;else{const u=new RegExp(n.source,n.flags+"g");for(;(e=u.exec(s))!==null;)l.push(s.substring(g,e.index)),l.push(i(...e)),g=e.index+e[0].length}return l.push(s.substring(g)),l.join("")};exports.mapRegExp=o;