summaryrefslogtreecommitdiffstats
path: root/lib/utils/string.js
diff options
context:
space:
mode:
authorSindre Sorhus <sindresorhus@gmail.com>2015-04-08 18:24:26 +0700
committerSindre Sorhus <sindresorhus@gmail.com>2015-04-08 18:24:26 +0700
commit6b56c7de7f664454ff16eb2a8ad0790c022e5a74 (patch)
treebbb8573c5712da37c4f683b037daa4e2a3fc2786 /lib/utils/string.js
parent334f782aa80599f4885b531548ad8661fd475ebb (diff)
downloadgitbook-6b56c7de7f664454ff16eb2a8ad0790c022e5a74.zip
gitbook-6b56c7de7f664454ff16eb2a8ad0790c022e5a74.tar.gz
gitbook-6b56c7de7f664454ff16eb2a8ad0790c022e5a74.tar.bz2
use the `escape-string-regexp` module
no point in hardcoding this. https://github.com/sindresorhus/escape-string-regexp
Diffstat (limited to 'lib/utils/string.js')
-rw-r--r--lib/utils/string.js5
1 files changed, 0 insertions, 5 deletions
diff --git a/lib/utils/string.js b/lib/utils/string.js
index 588f4d9..72a9ca0 100644
--- a/lib/utils/string.js
+++ b/lib/utils/string.js
@@ -20,12 +20,7 @@ function optionsToShellArgs(options) {
.join(" ");
}
-function escapeRegex(str) {
- return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
-}
-
module.exports = {
- escapeRegex: escapeRegex,
escapeShellArg: escapeShellArg,
optionsToShellArgs: optionsToShellArgs,
toLowerCase: String.prototype.toLowerCase.call.bind(String.prototype.toLowerCase)