@poe-platform/safe-js 0.1.203 → 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.
@@ -35154,6 +35154,45 @@ function createRegexGlobals(options) {
35154
35154
  }
35155
35155
  };
35156
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
+ });
35157
35196
  const prototype = /* @__PURE__ */ Object.create(null);
35158
35197
  Object.defineProperty(materializeFunctionProperties(constructor), Symbol.species, {
35159
35198
  get: accessorAdapter(createSandboxClosure({
@@ -37617,4 +37656,4 @@ export {
37617
37656
  FileSnapshotBackend,
37618
37657
  run
37619
37658
  };
37620
- //# sourceMappingURL=chunk-SYMTPL3Q.js.map
37659
+ //# sourceMappingURL=chunk-EOTY4PCT.js.map