highlight-words-core
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -182,6 +182,14 @@ module.exports = | ||
while (match = regex.exec(textToHighlight)) { | ||
chunks.push({ | ||
start: match.index, | ||
end: regex.lastIndex | ||
}); | ||
var start = match.index; | ||
var end = regex.lastIndex; | ||
// We do not return zero-length matches | ||
if (end > start) { | ||
chunks.push({ start: start, end: end }); | ||
} | ||
// Prevent browsers like Firefox from getting stuck in an infinite loop | ||
// See http://www.regexguru.com/2008/04/watch-out-for-zero-length-matches/ | ||
if (match.index == regex.lastIndex) { | ||
regex.lastIndex++; | ||
} | ||
} | ||
@@ -188,0 +196,0 @@ |
{ | ||
"name": "highlight-words-core", | ||
"description": "Utility functions shared by react-highlight-words and react-native-highlight-words", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"author": "Brian Vaughn <brian.david.vaughn@gmail.com>", | ||
@@ -45,5 +45,2 @@ "license": "MIT", | ||
}, | ||
"dependencies": { | ||
"babel-runtime": "^6.11.6" | ||
}, | ||
"devDependencies": { | ||
@@ -54,8 +51,3 @@ "babel-cli": "6.8.0", | ||
"babel-loader": "^6.2.3", | ||
"babel-plugin-transform-runtime": "^6.15.0", | ||
"babel-plugin-typecheck": "^3.9.0", | ||
"babel-polyfill": "^6.5.0", | ||
"babel-preset-es2015": "^6.14.0", | ||
"babel-preset-es2015-rollup": "^1.1.1", | ||
"babel-preset-stage-1": "^6.5.0", | ||
"cross-env": "^1.0.7", | ||
@@ -67,5 +59,4 @@ "expect.js": "^0.3.1", | ||
"standard": "^7.0.1", | ||
"watch": "^0.18.0", | ||
"webpack": "^1.9.6" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
0
12
218
131492
- Removedbabel-runtime@^6.11.6
- Removedbabel-runtime@6.26.0(transitive)
- Removedcore-js@2.6.12(transitive)
- Removedregenerator-runtime@0.11.1(transitive)