@catladder/cli 0.0.0-main-379f0956 → 0.0.0-main-35ebcfb1

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.
@@ -939,12 +939,15 @@ const BashExpression_1 = __nccwpck_require__(2376);
939
939
  // and adjusted a bit
940
940
  async function replaceAsync(string, searchValue, replacer) {
941
941
  const wasBashExpression = string instanceof BashExpression_1.BashExpression;
942
+ const stringRepresentation = wasBashExpression
943
+ ? string.toString()
944
+ : (0, BashExpression_1.bashEscape)(string);
942
945
  try {
943
946
  // 1. Run fake pass of `replace`, collect values from `replacer` calls
944
947
  // 2. Resolve them with `Promise.all`
945
948
  // 3. Run `replace` with resolved values
946
949
  const values = [];
947
- String.prototype.replace.call(string.toString(), searchValue, function (...args) {
950
+ String.prototype.replace.call(stringRepresentation, searchValue, function (...args) {
948
951
  // eslint-disable-next-line prefer-spread
949
952
  const result = replacer.apply(undefined, args);
950
953
  values.push(result);
@@ -952,7 +955,7 @@ async function replaceAsync(string, searchValue, replacer) {
952
955
  });
953
956
  const resolvedValues = await Promise.all(values);
954
957
  const containsBashExpression = resolvedValues.some((value) => value instanceof BashExpression_1.BashExpression);
955
- const result = String.prototype.replace.call(string.toString(), searchValue, function () {
958
+ const result = String.prototype.replace.call(stringRepresentation, searchValue, function () {
956
959
  var _a, _b;
957
960
  return (_b = (_a = resolvedValues.shift()) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : "";
958
961
  });
@@ -4107,12 +4107,15 @@ const BashExpression_1 = __nccwpck_require__(42376);
4107
4107
  // and adjusted a bit
4108
4108
  async function replaceAsync(string, searchValue, replacer) {
4109
4109
  const wasBashExpression = string instanceof BashExpression_1.BashExpression;
4110
+ const stringRepresentation = wasBashExpression
4111
+ ? string.toString()
4112
+ : (0, BashExpression_1.bashEscape)(string);
4110
4113
  try {
4111
4114
  // 1. Run fake pass of `replace`, collect values from `replacer` calls
4112
4115
  // 2. Resolve them with `Promise.all`
4113
4116
  // 3. Run `replace` with resolved values
4114
4117
  const values = [];
4115
- String.prototype.replace.call(string.toString(), searchValue, function (...args) {
4118
+ String.prototype.replace.call(stringRepresentation, searchValue, function (...args) {
4116
4119
  // eslint-disable-next-line prefer-spread
4117
4120
  const result = replacer.apply(undefined, args);
4118
4121
  values.push(result);
@@ -4120,7 +4123,7 @@ async function replaceAsync(string, searchValue, replacer) {
4120
4123
  });
4121
4124
  const resolvedValues = await Promise.all(values);
4122
4125
  const containsBashExpression = resolvedValues.some((value) => value instanceof BashExpression_1.BashExpression);
4123
- const result = String.prototype.replace.call(string.toString(), searchValue, function () {
4126
+ const result = String.prototype.replace.call(stringRepresentation, searchValue, function () {
4124
4127
  var _a, _b;
4125
4128
  return (_b = (_a = resolvedValues.shift()) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : "";
4126
4129
  });
@@ -5,12 +5,15 @@ const BashExpression_1 = require("./BashExpression");
5
5
  // and adjusted a bit
6
6
  async function replaceAsync(string, searchValue, replacer) {
7
7
  const wasBashExpression = string instanceof BashExpression_1.BashExpression;
8
+ const stringRepresentation = wasBashExpression
9
+ ? string.toString()
10
+ : (0, BashExpression_1.bashEscape)(string);
8
11
  try {
9
12
  // 1. Run fake pass of `replace`, collect values from `replacer` calls
10
13
  // 2. Resolve them with `Promise.all`
11
14
  // 3. Run `replace` with resolved values
12
15
  const values = [];
13
- String.prototype.replace.call(string.toString(), searchValue, function (...args) {
16
+ String.prototype.replace.call(stringRepresentation, searchValue, function (...args) {
14
17
  // eslint-disable-next-line prefer-spread
15
18
  const result = replacer.apply(undefined, args);
16
19
  values.push(result);
@@ -18,7 +21,7 @@ async function replaceAsync(string, searchValue, replacer) {
18
21
  });
19
22
  const resolvedValues = await Promise.all(values);
20
23
  const containsBashExpression = resolvedValues.some((value) => value instanceof BashExpression_1.BashExpression);
21
- const result = String.prototype.replace.call(string.toString(), searchValue, function () {
24
+ const result = String.prototype.replace.call(stringRepresentation, searchValue, function () {
22
25
  var _a, _b;
23
26
  return (_b = (_a = resolvedValues.shift()) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : "";
24
27
  });
@@ -1 +1 @@
1
- {"version":3,"file":"replaceAsync.js","sourceRoot":"","sources":["../../../../../pipeline/src/bash/replaceAsync.ts"],"names":[],"mappings":";;AAAA,qDAAkD;AAElD,wEAAwE;AACxE,qBAAqB;AACN,KAAK,UAAU,YAAY,CACxC,MAA+B,EAC/B,WAAgB,EAChB,QAGqC;IAErC,MAAM,iBAAiB,GAAG,MAAM,YAAY,+BAAc,CAAC;IAC3D,IAAI,CAAC;QACH,sEAAsE;QACtE,qCAAqC;QACrC,wCAAwC;QACxC,MAAM,MAAM,GAA4C,EAAE,CAAC;QAC3D,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAC3B,MAAM,CAAC,QAAQ,EAAE,EACjB,WAAW,EACX,UAAU,GAAG,IAAI;YACf,yCAAyC;YACzC,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YAC/C,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACpB,OAAO,EAAE,CAAC;QACZ,CAAC,CACF,CAAC;QACF,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAEjD,MAAM,sBAAsB,GAAG,cAAc,CAAC,IAAI,CAChD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,YAAY,+BAAc,CAC3C,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAC1C,MAAM,CAAC,QAAQ,EAAE,EACjB,WAAW,EACX;;YACE,OAAO,MAAA,MAAA,cAAc,CAAC,KAAK,EAAE,0CAAE,QAAQ,EAAE,mCAAI,EAAE,CAAC;QAClD,CAAC,CACF,CAAC;QACF,IAAI,iBAAiB,IAAI,sBAAsB,EAAE,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