Files
coopgo/node_modules/xml-utils/index-of-match.mjs
sgauthier 6e64e138e2
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
planning
2024-10-14 09:15:30 +02:00

7 lines
213 B
JavaScript

export default function indexOfMatch(xml, pattern, startIndex) {
const re = new RegExp(pattern);
const match = re.exec(xml.slice(startIndex));
if (match) return startIndex + match.index;
else return -1;
}