@poe-platform/safe-js 0.1.122 → 0.1.123

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.
@@ -27,7 +27,7 @@ import {
27
27
  validateMigrationSemantics,
28
28
  validateSnapshotData,
29
29
  validateSnapshotMigration
30
- } from "./chunk-OZTC4BT3.js";
30
+ } from "./chunk-N3CN2ACZ.js";
31
31
 
32
32
  // packages/safe-js/src/migrate.ts
33
33
  import { createHash } from "node:crypto";
@@ -8245,4 +8245,4 @@ export {
8245
8245
  parseMcpConfig,
8246
8246
  makeMcpModule
8247
8247
  };
8248
- //# sourceMappingURL=chunk-MQSVO6I2.js.map
8248
+ //# sourceMappingURL=chunk-3JECZNKB.js.map
@@ -8576,7 +8576,8 @@ async function callRegexMethod(target, methodName, args, budget, context) {
8576
8576
  }
8577
8577
  const retained = {};
8578
8578
  let cursor;
8579
- budget.setRetainedValues(retained, () => [target, ...args, cursor]);
8579
+ let convertedInput;
8580
+ budget.setRetainedValues(retained, () => [target, ...args, cursor, convertedInput]);
8580
8581
  try {
8581
8582
  const input = await sandboxString(args[0], budget, context);
8582
8583
  if (methodName === "test") {
@@ -8590,6 +8591,7 @@ async function callRegexMethod(target, methodName, args, budget, context) {
8590
8591
  }
8591
8592
  }
8592
8593
  if (!isSandboxRegex(target)) throw new TypeError("RegExp execution requires a regex receiver.");
8594
+ if (typeof args[0] !== "string") convertedInput = input;
8593
8595
  cursor = target.lastIndex;
8594
8596
  const lastIndex = await sandboxNumber(cursor, budget, context);
8595
8597
  const match = executeRegex(target, input, lastIndex);
@@ -25219,7 +25221,7 @@ async function replaceRegex(value, regex, replacement, replaceAll, budget, callC
25219
25221
  if (regex.flags.includes("g")) regex.lastIndex = 0;
25220
25222
  const cursor = regex.lastIndex;
25221
25223
  const retained = {};
25222
- budget.setRetainedValues(retained, () => [regex, cursor, replacement]);
25224
+ budget.setRetainedValues(retained, () => [value, regex, cursor, replacement]);
25223
25225
  try {
25224
25226
  const lastIndex = await sandboxNumber(cursor, budget, context);
25225
25227
  const matches = collectRegexMatches(regex, value, replaceAll || regex.flags.includes("g"), void 0, lastIndex);
@@ -25352,7 +25354,7 @@ async function callStringPattern(value, methodName, pattern, budget, parent, con
25352
25354
  const operation = budget.acquireCompileOwner(false, parent?.owner);
25353
25355
  const compilation = new CompileScope(operation.owner);
25354
25356
  const retainedPattern = {};
25355
- budget.setRetainedValues(retainedPattern, () => [pattern]);
25357
+ budget.setRetainedValues(retainedPattern, () => [value, pattern]);
25356
25358
  try {
25357
25359
  const source = pattern === void 0 ? "" : await sandboxString(pattern, budget, context);
25358
25360
  const regex = createSandboxRegex(source, methodName === "matchAll" ? "g" : "", 0, compilation);
@@ -25368,7 +25370,7 @@ async function callStringRegexCursor(value, methodName, regex, budget, parent, c
25368
25370
  const compilation = new CompileScope(operation.owner);
25369
25371
  const cursor = regex.lastIndex;
25370
25372
  const retained = {};
25371
- budget.setRetainedValues(retained, () => [regex, cursor]);
25373
+ budget.setRetainedValues(retained, () => [value, regex, cursor]);
25372
25374
  try {
25373
25375
  const lastIndex = await sandboxNumber(cursor, budget, context);
25374
25376
  return callMatchLikeMethod(value, methodName, [regex], compilation, lastIndex);
@@ -33418,4 +33420,4 @@ export {
33418
33420
  FileSnapshotBackend,
33419
33421
  run
33420
33422
  };
33421
- //# sourceMappingURL=chunk-OZTC4BT3.js.map
33423
+ //# sourceMappingURL=chunk-N3CN2ACZ.js.map