diginext-utils
Version:
README.md
15 lines • 422 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = indexesOf;
function indexesOf(str, regex) {
let match, indexes = {};
const list = [];
regex = new RegExp(regex);
while ((match = regex.exec(str))) {
if (!indexes[match[0]])
indexes[match[0]] = [];
list.push(match.index);
}
return list;
}
//# sourceMappingURL=indexesOf.js.map