UNPKG
@ajwest/too-wordy
Version:
latest (0.1.4)
0.1.4
Find wordy or unnecessary passages in your writing
github.com/duereg/too-wordy
duereg/too-wordy
@ajwest/too-wordy
/
matcher.js
12 lines
(8 loc)
•
223 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
var
matcher =
function
(
regex, text, type
)
{
var
results = [];
while
(result = regex.
exec
(text)) { results.
push
({
index
: result.index,
offset
: result[
0
].length}); }
return
results; }; module.exports = matcher;