@catladder/pipeline 1.169.0 → 1.170.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -123,16 +123,17 @@ var BashExpression_1 = require("./BashExpression");
123
123
  // and adjusted a bit
124
124
  function replaceAsync(string, searchValue, replacer) {
125
125
  return __awaiter(this, void 0, void 0, function () {
126
- var wasBashExpression, values_1, resolvedValues_1, containsBashExpression, result, error_1;
126
+ var wasBashExpression, stringRepresentation, values_1, resolvedValues_1, containsBashExpression, result, error_1;
127
127
  return __generator(this, function (_a) {
128
128
  switch (_a.label) {
129
129
  case 0:
130
130
  wasBashExpression = string instanceof BashExpression_1.BashExpression;
131
+ stringRepresentation = wasBashExpression ? string.toString() : (0, BashExpression_1.bashEscape)(string);
131
132
  _a.label = 1;
132
133
  case 1:
133
134
  _a.trys.push([1, 3,, 4]);
134
135
  values_1 = [];
135
- String.prototype.replace.call(string.toString(), searchValue, function () {
136
+ String.prototype.replace.call(stringRepresentation, searchValue, function () {
136
137
  var args = [];
137
138
  for (var _i = 0; _i < arguments.length; _i++) {
138
139
  args[_i] = arguments[_i];
@@ -148,7 +149,7 @@ function replaceAsync(string, searchValue, replacer) {
148
149
  containsBashExpression = resolvedValues_1.some(function (value) {
149
150
  return value instanceof BashExpression_1.BashExpression;
150
151
  });
151
- result = String.prototype.replace.call(string.toString(), searchValue, function () {
152
+ result = String.prototype.replace.call(stringRepresentation, searchValue, function () {
152
153
  var _a, _b;
153
154
  return (_b = (_a = resolvedValues_1.shift()) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : "";
154
155
  });