@poe-platform/safe-bash 0.1.519 → 0.1.520

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.
@@ -38024,10 +38024,12 @@ shell: command substitution: line ${line}: \`${sourceLine}'
38024
38024
  if (character === "'") {
38025
38025
  const nul = bytes3.indexOf(0);
38026
38026
  const raw = Uint8Array.from(nul < 0 ? bytes3 : bytes3.slice(0, nul));
38027
+ const decoder2 = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
38027
38028
  try {
38028
- return new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(raw);
38029
+ return decoder2.decode(raw);
38029
38030
  } catch (error) {
38030
- if (!(error instanceof TypeError) || !("code" in error) || error.code !== "ERR_ENCODING_INVALID_ENCODED_DATA") throw error;
38031
+ this.budget.admit(0);
38032
+ if (!(error instanceof TypeError) || "code" in error && error.code !== "ERR_ENCODING_INVALID_ENCODED_DATA") throw error;
38031
38033
  this.budget.admit(2);
38032
38034
  return shellValueFromBytes(raw);
38033
38035
  }
@@ -46274,10 +46276,12 @@ ${prefix3} line ${offset + line}: \`${source2.split("\n")[line - 1] ?? ""}'
46274
46276
  for (const byte of bytes3) if (byte !== 0) bytes3[length++] = byte;
46275
46277
  while (length && bytes3[length - 1] === 10) length--;
46276
46278
  const sanitized = bytes3.subarray(0, length);
46279
+ const decoder2 = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
46277
46280
  try {
46278
- return new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(sanitized);
46281
+ return decoder2.decode(sanitized);
46279
46282
  } catch (error) {
46280
- if (!(error instanceof TypeError) || error.code !== "ERR_ENCODING_INVALID_ENCODED_DATA") throw error;
46283
+ this.signal.throwIfAborted();
46284
+ if (!(error instanceof TypeError) || "code" in error && error.code !== "ERR_ENCODING_INVALID_ENCODED_DATA") throw error;
46281
46285
  return shellValueFromBytes(sanitized, io[valueScope]);
46282
46286
  }
46283
46287
  }