mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
9 lines
183 B
JavaScript
9 lines
183 B
JavaScript
'use strict';
|
|
module.exports = function (str) {
|
|
if (typeof str !== 'string') {
|
|
throw new TypeError('Expected a string');
|
|
}
|
|
|
|
return str.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
|
|
};
|