UNPKG

test-openapi

Version:
36 lines (20 loc) 728 B
"use strict";require("core-js/modules/es.array.flat-map");require("core-js/modules/es.array.unscopables.flat-map");Object.defineProperty(exports,"__esModule",{value:true});exports.searchRegExp=void 0; const searchRegExp=function(regExp,string){ const delims=string.match(regExp); if(delims===null){ return; } const matches=string.split(regExp); const tokens=matches.flatMap((match,index)=> interleaveDelims({match,index,delims})); const tokensA=tokens.filter(token=>token!==""); return tokensA; };exports.searchRegExp=searchRegExp; const interleaveDelims=function({match,index,delims}){ const delim=delims[index]; if(delim===undefined){ return[match]; } return[match,delim]; }; //# sourceMappingURL=search.js.map