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 +39 -1
- package/dist/index.js.map +2 -2
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safejs/dist/chunks/{chunk-73RTIWRH.js → chunk-T55OILHA.js} +2 -2
- package/packages/safejs/dist/chunks/{chunk-HD7TQKZ7.js → chunk-Z3ZMLYCK.js} +39 -1
- package/packages/safejs/dist/chunks/{chunk-HD7TQKZ7.js.map → chunk-Z3ZMLYCK.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.d.ts +1 -1
- package/packages/safejs/dist/interp/methods/string.js +43 -1
- /package/packages/safejs/dist/chunks/{chunk-73RTIWRH.js.map → chunk-T55OILHA.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-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-
|
|
8058
|
+
//# sourceMappingURL=chunk-T55OILHA.js.map
|
|
@@ -25224,6 +25224,7 @@ var stringMethodNames = /* @__PURE__ */ new Set([
|
|
|
25224
25224
|
"includes",
|
|
25225
25225
|
"indexOf",
|
|
25226
25226
|
"lastIndexOf",
|
|
25227
|
+
"localeCompare",
|
|
25227
25228
|
"match",
|
|
25228
25229
|
"matchAll",
|
|
25229
25230
|
"normalize",
|
|
@@ -25258,6 +25259,7 @@ function getStringMember(value, property, budget) {
|
|
|
25258
25259
|
return createSandboxClosure({
|
|
25259
25260
|
sandbox: true,
|
|
25260
25261
|
name: `String#${property}`,
|
|
25262
|
+
...property === "localeCompare" ? { length: 1 } : {},
|
|
25261
25263
|
call: (args) => callStringMethod(value, property, args, budget)
|
|
25262
25264
|
});
|
|
25263
25265
|
}
|
|
@@ -25283,6 +25285,42 @@ function callStringMethod(value, methodName, args, budget, callClosure = async (
|
|
|
25283
25285
|
if (methodName === "match" || methodName === "matchAll" || methodName === "search") {
|
|
25284
25286
|
return callMatchLikeMethod(value, methodName, args);
|
|
25285
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
|
+
}
|
|
25286
25324
|
if (args.some(isSandboxClosure)) {
|
|
25287
25325
|
throw new TypeError(`String#${methodName} does not support function arguments.`);
|
|
25288
25326
|
}
|
|
@@ -29256,4 +29294,4 @@ export {
|
|
|
29256
29294
|
FileSnapshotBackend,
|
|
29257
29295
|
run
|
|
29258
29296
|
};
|
|
29259
|
-
//# sourceMappingURL=chunk-
|
|
29297
|
+
//# sourceMappingURL=chunk-Z3ZMLYCK.js.map
|