poe-code 12.0.1 → 12.0.2

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 CHANGED
@@ -144324,6 +144324,7 @@ function getStringMember(value, property, budget) {
144324
144324
  return createSandboxClosure({
144325
144325
  sandbox: true,
144326
144326
  name: `String#${property}`,
144327
+ ...property === "localeCompare" ? { length: 1 } : {},
144327
144328
  call: (args) => callStringMethod(value, property, args, budget)
144328
144329
  });
144329
144330
  }
@@ -144349,6 +144350,42 @@ function callStringMethod(value, methodName, args, budget, callClosure = async (
144349
144350
  if (methodName === "match" || methodName === "matchAll" || methodName === "search") {
144350
144351
  return callMatchLikeMethod(value, methodName, args);
144351
144352
  }
144353
+ if (methodName === "localeCompare") {
144354
+ if (isSandboxClosure(args[0])) {
144355
+ throw new TypeError("String#localeCompare does not support function comparison values.");
144356
+ }
144357
+ const comparison = budget.allocateString(String(deepCopyFromSandbox(args[0])));
144358
+ const locales = Reflect.apply(Intl.getCanonicalLocales, Intl, [
144359
+ deepCopyFromSandbox(args[1])
144360
+ ]);
144361
+ const options = args[2];
144362
+ const nativeOptions = options === void 0 || options === null ? options : Object.fromEntries(
144363
+ [
144364
+ "usage",
144365
+ "localeMatcher",
144366
+ "collation",
144367
+ "numeric",
144368
+ "caseFirst",
144369
+ "sensitivity",
144370
+ "ignorePunctuation"
144371
+ ].map((property) => {
144372
+ const descriptor = Object.getOwnPropertyDescriptor(options, property);
144373
+ if (descriptor !== void 0 && !("value" in descriptor)) {
144374
+ throw new TypeError("String#localeCompare only supports data option properties.");
144375
+ }
144376
+ const option = descriptor?.value;
144377
+ return [
144378
+ property,
144379
+ option === void 0 ? void 0 : property === "numeric" || property === "ignorePunctuation" ? Boolean(option) : deepCopyFromSandbox(option)
144380
+ ];
144381
+ })
144382
+ );
144383
+ return Reflect.apply(String.prototype.localeCompare, value, [
144384
+ comparison,
144385
+ locales,
144386
+ nativeOptions
144387
+ ]);
144388
+ }
144352
144389
  if (args.some(isSandboxClosure)) {
144353
144390
  throw new TypeError(`String#${methodName} does not support function arguments.`);
144354
144391
  }
@@ -144624,6 +144661,7 @@ var init_string = __esm({
144624
144661
  "includes",
144625
144662
  "indexOf",
144626
144663
  "lastIndexOf",
144664
+ "localeCompare",
144627
144665
  "match",
144628
144666
  "matchAll",
144629
144667
  "normalize",
@@ -155754,7 +155792,7 @@ var init_package2 = __esm({
155754
155792
  "package.json"() {
155755
155793
  package_default2 = {
155756
155794
  name: "poe-code",
155757
- version: "12.0.1",
155795
+ version: "12.0.2",
155758
155796
  description: "CLI tool to configure Poe API for developer workflows.",
155759
155797
  license: "MIT",
155760
155798
  type: "module",