poe-code 12.0.0 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poe-code",
3
- "version": "12.0.0",
3
+ "version": "12.0.2",
4
4
  "description": "CLI tool to configure Poe API for developer workflows.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,7 +27,7 @@ import {
27
27
  validateMigrationSemantics,
28
28
  validateSnapshotData,
29
29
  validateSnapshotMigration
30
- } from "./chunk-YE6I5W6O.js";
30
+ } from "./chunk-Z3ZMLYCK.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-6EXLQKE5.js.map
8058
+ //# sourceMappingURL=chunk-T55OILHA.js.map
@@ -23875,7 +23875,9 @@ function createObjectArrayGlobals(options) {
23875
23875
  }),
23876
23876
  String: createSandboxClosure({
23877
23877
  sandbox: true,
23878
- call: ([value]) => options.budget.allocateString(String(value)),
23878
+ call: ([value]) => options.budget.allocateString(
23879
+ typeof value === "object" && value !== null && sandboxErrorTypes.has(value) && !Object.hasOwn(value, "toString") ? Error.prototype.toString.call(value) : String(value)
23880
+ ),
23879
23881
  name: "String",
23880
23882
  properties: {
23881
23883
  raw: createSandboxClosure({
@@ -25222,6 +25224,7 @@ var stringMethodNames = /* @__PURE__ */ new Set([
25222
25224
  "includes",
25223
25225
  "indexOf",
25224
25226
  "lastIndexOf",
25227
+ "localeCompare",
25225
25228
  "match",
25226
25229
  "matchAll",
25227
25230
  "normalize",
@@ -25256,6 +25259,7 @@ function getStringMember(value, property, budget) {
25256
25259
  return createSandboxClosure({
25257
25260
  sandbox: true,
25258
25261
  name: `String#${property}`,
25262
+ ...property === "localeCompare" ? { length: 1 } : {},
25259
25263
  call: (args) => callStringMethod(value, property, args, budget)
25260
25264
  });
25261
25265
  }
@@ -25281,6 +25285,42 @@ function callStringMethod(value, methodName, args, budget, callClosure = async (
25281
25285
  if (methodName === "match" || methodName === "matchAll" || methodName === "search") {
25282
25286
  return callMatchLikeMethod(value, methodName, args);
25283
25287
  }
25288
+ if (methodName === "localeCompare") {
25289
+ if (isSandboxClosure(args[0])) {
25290
+ throw new TypeError("String#localeCompare does not support function comparison values.");
25291
+ }
25292
+ const comparison = budget.allocateString(String(deepCopyFromSandbox(args[0])));
25293
+ const locales = Reflect.apply(Intl.getCanonicalLocales, Intl, [
25294
+ deepCopyFromSandbox(args[1])
25295
+ ]);
25296
+ const options = args[2];
25297
+ const nativeOptions = options === void 0 || options === null ? options : Object.fromEntries(
25298
+ [
25299
+ "usage",
25300
+ "localeMatcher",
25301
+ "collation",
25302
+ "numeric",
25303
+ "caseFirst",
25304
+ "sensitivity",
25305
+ "ignorePunctuation"
25306
+ ].map((property) => {
25307
+ const descriptor = Object.getOwnPropertyDescriptor(options, property);
25308
+ if (descriptor !== void 0 && !("value" in descriptor)) {
25309
+ throw new TypeError("String#localeCompare only supports data option properties.");
25310
+ }
25311
+ const option = descriptor?.value;
25312
+ return [
25313
+ property,
25314
+ option === void 0 ? void 0 : property === "numeric" || property === "ignorePunctuation" ? Boolean(option) : deepCopyFromSandbox(option)
25315
+ ];
25316
+ })
25317
+ );
25318
+ return Reflect.apply(String.prototype.localeCompare, value, [
25319
+ comparison,
25320
+ locales,
25321
+ nativeOptions
25322
+ ]);
25323
+ }
25284
25324
  if (args.some(isSandboxClosure)) {
25285
25325
  throw new TypeError(`String#${methodName} does not support function arguments.`);
25286
25326
  }
@@ -29254,4 +29294,4 @@ export {
29254
29294
  FileSnapshotBackend,
29255
29295
  run
29256
29296
  };
29257
- //# sourceMappingURL=chunk-YE6I5W6O.js.map
29297
+ //# sourceMappingURL=chunk-Z3ZMLYCK.js.map