@poe-platform/safe-js 0.1.180 → 0.1.182
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/safe-js/chunks/{chunk-V2ZFZP6Y.js → chunk-A6KP64IV.js} +22 -4
- package/dist/safe-js/chunks/{chunk-V2ZFZP6Y.js.map → chunk-A6KP64IV.js.map} +2 -2
- package/dist/safe-js/chunks/{chunk-TCWUH7BD.js → chunk-J5JNS3B3.js} +2 -2
- package/dist/safe-js/cli.js +2 -2
- package/dist/safe-js/core.js +1 -1
- package/dist/safe-js/index.js +2 -2
- package/package.json +2 -2
- /package/dist/safe-js/chunks/{chunk-TCWUH7BD.js.map → chunk-J5JNS3B3.js.map} +0 -0
|
@@ -10658,8 +10658,10 @@ function callStringMethodBody(value, methodName, args, budget, parent, context)
|
|
|
10658
10658
|
return budget.allocateString(result + value.slice(spanStart));
|
|
10659
10659
|
}
|
|
10660
10660
|
const regex = args[0];
|
|
10661
|
-
if (methodName === "
|
|
10662
|
-
return
|
|
10661
|
+
if (methodName === "search" && isSandboxRegex(regex) && getSandboxPropertyDescriptor(regex, "exec", budget) !== void 0)
|
|
10662
|
+
return callCustomRegexSearch(value, regex, budget, context);
|
|
10663
|
+
if (methodName === "match" && isSandboxRegex(regex) && ["exec", "flags", ...Object.keys(regexFlagProperties)].some((key) => getSandboxPropertyDescriptor(regex, key, budget) !== void 0))
|
|
10664
|
+
return callObservableRegexMatch(value, regex, budget, context);
|
|
10663
10665
|
if (isSandboxRegex(regex) && (methodName === "matchAll" || methodName === "match" && !regex.flags.includes("g") && regex.lastIndex !== null && typeof regex.lastIndex === "object")) {
|
|
10664
10666
|
return callStringRegexCursor(value, methodName, regex, budget, parent, context);
|
|
10665
10667
|
}
|
|
@@ -11007,7 +11009,23 @@ async function callStringPattern(value, methodName, pattern, budget, parent, con
|
|
|
11007
11009
|
operation.release();
|
|
11008
11010
|
}
|
|
11009
11011
|
}
|
|
11010
|
-
async function
|
|
11012
|
+
async function callCustomRegexSearch(value, regex, budget, context) {
|
|
11013
|
+
const previousIndex = regex.lastIndex;
|
|
11014
|
+
let result;
|
|
11015
|
+
const release = retainValues(budget, () => [value, regex, previousIndex, result]);
|
|
11016
|
+
try {
|
|
11017
|
+
if (!Object.is(previousIndex, 0)) regex.lastIndex = 0;
|
|
11018
|
+
result = await regexExec(regex, value, budget, context);
|
|
11019
|
+
if (!Object.is(regex.lastIndex, previousIndex)) regex.lastIndex = previousIndex;
|
|
11020
|
+
if (result === null) return -1;
|
|
11021
|
+
if (context?.getProperty !== void 0) return await context.getProperty(result, "index");
|
|
11022
|
+
const descriptor = getSandboxPropertyDescriptor(result, "index", budget);
|
|
11023
|
+
return descriptor === void 0 ? void 0 : await readPropertyDescriptor(descriptor, result, context);
|
|
11024
|
+
} finally {
|
|
11025
|
+
release();
|
|
11026
|
+
}
|
|
11027
|
+
}
|
|
11028
|
+
async function callObservableRegexMatch(value, regex, budget, context) {
|
|
11011
11029
|
const matches = [];
|
|
11012
11030
|
let result;
|
|
11013
11031
|
let matched;
|
|
@@ -36549,4 +36567,4 @@ export {
|
|
|
36549
36567
|
FileSnapshotBackend,
|
|
36550
36568
|
run
|
|
36551
36569
|
};
|
|
36552
|
-
//# sourceMappingURL=chunk-
|
|
36570
|
+
//# sourceMappingURL=chunk-A6KP64IV.js.map
|