@poe-platform/safe-js 0.1.290 → 0.1.291

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-GK6XA4H4.js";
30
+ } from "./chunk-ZOLHW4OV.js";
31
31
 
32
32
  // packages/safe-js/src/migrate.ts
33
33
  import { createHash } from "node:crypto";
@@ -8249,4 +8249,4 @@ export {
8249
8249
  parseMcpConfig,
8250
8250
  makeMcpModule
8251
8251
  };
8252
- //# sourceMappingURL=chunk-XCRTZUIR.js.map
8252
+ //# sourceMappingURL=chunk-DYGBPKZA.js.map
@@ -10567,6 +10567,17 @@ var collatorOptions = [
10567
10567
  ["sensitivity", ["base", "accent", "case", "variant"]],
10568
10568
  ["ignorePunctuation", "boolean"]
10569
10569
  ];
10570
+ async function changeStringLocaleCase(value, method, args, budget, context) {
10571
+ let locales = [];
10572
+ const release = retainValues(budget, () => [value, locales]);
10573
+ try {
10574
+ locales = await canonicalizeGuestLocales(args[0], budget, context);
10575
+ budget.visitNode(value.length);
10576
+ return budget.allocateString(Reflect.apply(String.prototype[method], value, [locales]));
10577
+ } finally {
10578
+ release();
10579
+ }
10580
+ }
10570
10581
  async function compareStringLocale(value, args, budget, context) {
10571
10582
  let comparison = "";
10572
10583
  let locales = [];
@@ -10619,6 +10630,8 @@ var stringMethodNames = /* @__PURE__ */ new Set([
10619
10630
  "substring",
10620
10631
  "toLowerCase",
10621
10632
  "toUpperCase",
10633
+ "toLocaleLowerCase",
10634
+ "toLocaleUpperCase",
10622
10635
  "toWellFormed",
10623
10636
  "trim",
10624
10637
  "trimEnd",
@@ -10638,6 +10651,7 @@ function getStringMember(value, property, budget) {
10638
10651
  return createSandboxClosure({
10639
10652
  sandbox: true,
10640
10653
  name: `String#${property}`,
10654
+ ...property === "toLocaleLowerCase" || property === "toLocaleUpperCase" ? { guest: true, name: property, length: 0 } : {},
10641
10655
  ...property === "localeCompare" ? { length: 1 } : {},
10642
10656
  ...property === "isWellFormed" || property === "toWellFormed" ? { length: 0 } : {},
10643
10657
  call: async (args, context) => {
@@ -10775,6 +10789,8 @@ function callStringMethodBody(value, methodName, args, budget, parent, context)
10775
10789
  if ((methodName === "match" || methodName === "matchAll" || methodName === "search") && !isSandboxRegex(args[0])) {
10776
10790
  return callStringPattern(value, methodName, args[0], budget, parent, context);
10777
10791
  }
10792
+ if (methodName === "toLocaleLowerCase" || methodName === "toLocaleUpperCase")
10793
+ return changeStringLocaleCase(value, methodName, args, budget, context);
10778
10794
  if (methodName === "localeCompare" && context?.getProperty !== void 0)
10779
10795
  return compareStringLocale(value, args, budget, context);
10780
10796
  const operation = budget.acquireCompileOwner(false, parent?.owner);
@@ -40503,4 +40519,4 @@ export {
40503
40519
  FileSnapshotBackend,
40504
40520
  run
40505
40521
  };
40506
- //# sourceMappingURL=chunk-GK6XA4H4.js.map
40522
+ //# sourceMappingURL=chunk-ZOLHW4OV.js.map