Plato on Github
Report Home
node_modules/es5-ext/reg-exp/escape.js
Maintainability
92.02
Lines of code
5
Difficulty
3.60
Estimated Errors
0.03
Function weight
By Complexity
By SLOC
// Thanks to Andrew Clover: // http://stackoverflow.com/questions/3561493 // /is-there-a-regexp-escape-function-in-javascript 'use strict'; var re = /[\-\/\\\^$*+?.()|\[\]{}]/g; module.exports = function (str) { return String(str).replace(re, '\\$&'); };