@poe-platform/safe-bash 0.1.65 → 0.1.66

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.
@@ -17249,9 +17249,16 @@ async function execute(program, context, files, quiet, budget) {
17249
17249
  }
17250
17250
  break;
17251
17251
  }
17252
- case "y":
17253
- pattern = [...pattern].map((character) => instruction.translation.get(character) ?? character).join("");
17252
+ case "y": {
17253
+ budget.step(pattern.length);
17254
+ const translated = import_buffer.Buffer.allocUnsafe(pattern.length);
17255
+ for (let index = 0; index < pattern.length; index++) {
17256
+ if (index % 256 === 0) await budget.checkpoint();
17257
+ translated[index] = (instruction.translation.get(pattern[index]) ?? pattern[index]).charCodeAt(0);
17258
+ }
17259
+ pattern = translated.toString("latin1");
17254
17260
  break;
17261
+ }
17255
17262
  case "b":
17256
17263
  pc = instruction.jump;
17257
17264
  continue;