@poe-platform/safe-js 0.1.202 → 0.1.204
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-JBRG5INL.js → chunk-EOTY4PCT.js} +41 -5
- package/dist/safe-js/chunks/chunk-EOTY4PCT.js.map +7 -0
- package/dist/safe-js/chunks/{chunk-TIWFGODB.js → chunk-Z2ZXS55C.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-JBRG5INL.js.map +0 -7
- /package/dist/safe-js/chunks/{chunk-TIWFGODB.js.map → chunk-Z2ZXS55C.js.map} +0 -0
|
@@ -9883,10 +9883,7 @@ function matchesCharacterClassItem(character, item, ignoreCase, unicode, unicode
|
|
|
9883
9883
|
if (!ignoreCase) {
|
|
9884
9884
|
return false;
|
|
9885
9885
|
}
|
|
9886
|
-
|
|
9887
|
-
const foldedFrom = foldCharacter(item.from, true).charCodeAt(0);
|
|
9888
|
-
const foldedTo = foldCharacter(item.to, true).charCodeAt(0);
|
|
9889
|
-
return foldedCandidate >= foldedFrom && foldedCandidate <= foldedTo;
|
|
9886
|
+
return new RegExp(`^[\\u${from.toString(16).padStart(4, "0")}-\\u${to.toString(16).padStart(4, "0")}]$`, "i").test(character);
|
|
9890
9887
|
}
|
|
9891
9888
|
const matched = item.kind === "digit" ? isDigit(character) : item.kind === "word" ? isWordCharacter(character) : isSpaceCharacter(character);
|
|
9892
9889
|
return item.negated ? !matched : matched;
|
|
@@ -35157,6 +35154,45 @@ function createRegexGlobals(options) {
|
|
|
35157
35154
|
}
|
|
35158
35155
|
};
|
|
35159
35156
|
const constructor = createSandboxClosure({ guest: true, sandbox: true, name: "RegExp", length: 2, call: invoke(false), construct: invoke(true) });
|
|
35157
|
+
Object.defineProperty(materializeFunctionProperties(constructor), "escape", {
|
|
35158
|
+
value: createSandboxClosure({
|
|
35159
|
+
guest: true,
|
|
35160
|
+
sandbox: true,
|
|
35161
|
+
name: "escape",
|
|
35162
|
+
length: 1,
|
|
35163
|
+
call: (args) => {
|
|
35164
|
+
const input = args[0];
|
|
35165
|
+
if (typeof input !== "string") throw new TypeError("RegExp.escape requires a string.");
|
|
35166
|
+
const allocation = {};
|
|
35167
|
+
let escaped = "";
|
|
35168
|
+
try {
|
|
35169
|
+
for (const character of input) {
|
|
35170
|
+
options.budget.visitNode();
|
|
35171
|
+
const point = character.codePointAt(0);
|
|
35172
|
+
let part = character;
|
|
35173
|
+
if (escaped.length === 0 && (point >= 48 && point <= 57 || point >= 65 && point <= 90 || point >= 97 && point <= 122)) {
|
|
35174
|
+
part = `\\x${point.toString(16)}`;
|
|
35175
|
+
} else if ("^$\\.*+?()[]{}|/".includes(character)) {
|
|
35176
|
+
part = "\\" + character;
|
|
35177
|
+
} else {
|
|
35178
|
+
const control = "\f\n\r \v".indexOf(character);
|
|
35179
|
+
if (control !== -1) part = "\\" + "fnrtv"[control];
|
|
35180
|
+
else if (",-=<>#&!%:;@~'`\"".includes(character) || character.trim() === "" || point >= 55296 && point <= 57343) {
|
|
35181
|
+
part = point <= 255 ? `\\x${point.toString(16).padStart(2, "0")}` : `\\u${point.toString(16).padStart(4, "0")}`;
|
|
35182
|
+
}
|
|
35183
|
+
}
|
|
35184
|
+
options.budget.setRetainedDataUsage(allocation, escaped.length + part.length);
|
|
35185
|
+
escaped = options.budget.allocateString(escaped + part);
|
|
35186
|
+
}
|
|
35187
|
+
return escaped;
|
|
35188
|
+
} finally {
|
|
35189
|
+
options.budget.setRetainedDataUsage(allocation, 0);
|
|
35190
|
+
}
|
|
35191
|
+
}
|
|
35192
|
+
}),
|
|
35193
|
+
writable: true,
|
|
35194
|
+
configurable: true
|
|
35195
|
+
});
|
|
35160
35196
|
const prototype = /* @__PURE__ */ Object.create(null);
|
|
35161
35197
|
Object.defineProperty(materializeFunctionProperties(constructor), Symbol.species, {
|
|
35162
35198
|
get: accessorAdapter(createSandboxClosure({
|
|
@@ -37620,4 +37656,4 @@ export {
|
|
|
37620
37656
|
FileSnapshotBackend,
|
|
37621
37657
|
run
|
|
37622
37658
|
};
|
|
37623
|
-
//# sourceMappingURL=chunk-
|
|
37659
|
+
//# sourceMappingURL=chunk-EOTY4PCT.js.map
|