mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-11-22 08:30:51 +00:00
11 lines
226 B
JavaScript
11 lines
226 B
JavaScript
'use strict';
|
|
|
|
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
|
|
|
|
module.exports = function (str) {
|
|
if (typeof str !== 'string') {
|
|
throw new TypeError('Expected a string');
|
|
}
|
|
|
|
return str.replace(matchOperatorsRe, '\\$&');
|
|
};
|