poe-code 11.0.12 → 11.0.13
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.
- package/dist/index.js +13 -8
- package/dist/index.js.map +3 -3
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safejs/dist/chunks/{chunk-WV23C6SS.js → chunk-EV4BL6HH.js} +2 -2
- package/packages/safejs/dist/chunks/{chunk-5BWI6HAZ.js → chunk-GTX2EXKD.js} +13 -7
- package/packages/safejs/dist/chunks/{chunk-5BWI6HAZ.js.map → chunk-GTX2EXKD.js.map} +2 -2
- package/packages/safejs/dist/cli.js +2 -2
- package/packages/safejs/dist/core.js +1 -1
- package/packages/safejs/dist/index.js +2 -2
- package/packages/safejs/dist/interp/methods/string.js +15 -8
- /package/packages/safejs/dist/chunks/{chunk-WV23C6SS.js.map → chunk-EV4BL6HH.js.map} +0 -0
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
validateMigrationSemantics,
|
|
28
28
|
validateSnapshotData,
|
|
29
29
|
validateSnapshotMigration
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-GTX2EXKD.js";
|
|
31
31
|
|
|
32
32
|
// packages/safejs/src/migrate.ts
|
|
33
33
|
import { createHash } from "node:crypto";
|
|
@@ -8055,4 +8055,4 @@ export {
|
|
|
8055
8055
|
parseMcpConfig,
|
|
8056
8056
|
makeMcpModule
|
|
8057
8057
|
};
|
|
8058
|
-
//# sourceMappingURL=chunk-
|
|
8058
|
+
//# sourceMappingURL=chunk-EV4BL6HH.js.map
|
|
@@ -25179,6 +25179,7 @@ function callReplaceLikeMethod(value, methodName, args, budget, callClosure) {
|
|
|
25179
25179
|
);
|
|
25180
25180
|
}
|
|
25181
25181
|
async function replaceRegex(value, regex, replacement, replaceAll, budget, callClosure) {
|
|
25182
|
+
if (regex.flags.includes("g")) regex.lastIndex = 0;
|
|
25182
25183
|
const matches = collectRegexMatches(regex, value, replaceAll || regex.flags.includes("g"));
|
|
25183
25184
|
let result = "";
|
|
25184
25185
|
let copiedThrough = 0;
|
|
@@ -25267,11 +25268,16 @@ function callSplit(value, args, budget) {
|
|
|
25267
25268
|
if (args.some(isSandboxClosure))
|
|
25268
25269
|
throw new TypeError("String#split does not support function arguments.");
|
|
25269
25270
|
if (isSandboxRegex(args[0])) {
|
|
25271
|
+
const regex = args[0];
|
|
25272
|
+
const splitter = createSandboxRegex(
|
|
25273
|
+
regex.source,
|
|
25274
|
+
regex.flags.includes("g") ? regex.flags : `${regex.flags}g`
|
|
25275
|
+
);
|
|
25270
25276
|
const limit2 = asNumberOrUndefined(args[1]) ?? 2 ** 32 - 1;
|
|
25271
25277
|
const result2 = [];
|
|
25272
25278
|
let copiedThrough = 0;
|
|
25273
25279
|
let endedWithZeroWidthMatch = false;
|
|
25274
|
-
for (const match of collectRegexMatches(
|
|
25280
|
+
for (const match of collectRegexMatches(splitter, value, true)) {
|
|
25275
25281
|
endedWithZeroWidthMatch = match.text.length === 0 && match.index === value.length;
|
|
25276
25282
|
if (match.text.length === 0 && match.index === 0) continue;
|
|
25277
25283
|
if (result2.length >= limit2) break;
|
|
@@ -25309,18 +25315,18 @@ function callMatchLikeMethod(value, methodName, args) {
|
|
|
25309
25315
|
throw new TypeError("String#matchAll requires a global regex.");
|
|
25310
25316
|
if (methodName === "match" && !regex.flags.includes("g"))
|
|
25311
25317
|
return toMatchArray(executeRegex(regex, value), value);
|
|
25312
|
-
|
|
25318
|
+
if (methodName === "match") regex.lastIndex = 0;
|
|
25319
|
+
const matcher = methodName === "matchAll" ? createSandboxRegex(regex.source, regex.flags, regex.lastIndex) : regex;
|
|
25320
|
+
const matches = collectRegexMatches(matcher, value, true);
|
|
25313
25321
|
return methodName === "match" ? matches.map((match) => match.text) : matches.map((match) => toMatchArray(match, value));
|
|
25314
25322
|
}
|
|
25315
25323
|
function collectRegexMatches(regex, value, all) {
|
|
25316
25324
|
const matches = [];
|
|
25317
|
-
const pattern = getSandboxRegexPattern(regex);
|
|
25318
|
-
let startIndex = 0;
|
|
25319
25325
|
do {
|
|
25320
|
-
const match =
|
|
25326
|
+
const match = executeRegex(regex, value);
|
|
25321
25327
|
if (match === null) break;
|
|
25322
25328
|
matches.push(match);
|
|
25323
|
-
|
|
25329
|
+
if (all && match.text.length === 0) regex.lastIndex += 1;
|
|
25324
25330
|
} while (all);
|
|
25325
25331
|
return matches;
|
|
25326
25332
|
}
|
|
@@ -29031,4 +29037,4 @@ export {
|
|
|
29031
29037
|
FileSnapshotBackend,
|
|
29032
29038
|
run
|
|
29033
29039
|
};
|
|
29034
|
-
//# sourceMappingURL=chunk-
|
|
29040
|
+
//# sourceMappingURL=chunk-GTX2EXKD.js.map
|