12 lines
198 B
JavaScript
12 lines
198 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const internals = {};
|
||
|
|
||
|
|
||
|
module.exports = function (string) {
|
||
|
|
||
|
// Escape ^$.*+-?=!:|\/()[]{},
|
||
|
|
||
|
return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&');
|
||
|
};
|