mirror of
https://github.com/azure/setup-kubectl.git
synced 2026-12-03 19:51:53 +00:00
7f7e5ba5ea
Co-authored-by: Oliver King <oking3@uncc.edu>
12 lines
226 B
JavaScript
12 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, '\\$&');
|
|
};
|