mirror of
https://github.com/Azure/setup-helm.git
synced 2026-07-07 00:41:38 +00:00
a517f2ff65
Co-authored-by: taakleton <taakleton@users.noreply.github.com>
12 lines
236 B
JavaScript
12 lines
236 B
JavaScript
'use strict';
|
|
|
|
const matchOperatorsRegex = /[|\\{}()[\]^$+*?.-]/g;
|
|
|
|
module.exports = string => {
|
|
if (typeof string !== 'string') {
|
|
throw new TypeError('Expected a string');
|
|
}
|
|
|
|
return string.replace(matchOperatorsRegex, '\\$&');
|
|
};
|