@poe-platform/safe-js 0.1.200 → 0.1.201

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.
@@ -27,7 +27,7 @@ import {
27
27
  validateMigrationSemantics,
28
28
  validateSnapshotData,
29
29
  validateSnapshotMigration
30
- } from "./chunk-OX7524JW.js";
30
+ } from "./chunk-JWZXP3IL.js";
31
31
 
32
32
  // packages/safe-js/src/migrate.ts
33
33
  import { createHash } from "node:crypto";
@@ -8249,4 +8249,4 @@ export {
8249
8249
  parseMcpConfig,
8250
8250
  makeMcpModule
8251
8251
  };
8252
- //# sourceMappingURL=chunk-6HCV5BAA.js.map
8252
+ //# sourceMappingURL=chunk-ARZPYB67.js.map
@@ -768,7 +768,7 @@ function measureNode(node) {
768
768
  return usage;
769
769
  }
770
770
  case "group":
771
- return 5 + measureNode(node.body) + (node.name === void 0 ? 0 : 1 + node.name.length);
771
+ return 5 + measureNode(node.body) + (node.name === void 0 ? 0 : 1 + node.name.length) + (node.modifiers === void 0 ? 0 : 2 + Object.keys(node.modifiers).length);
772
772
  case "lookahead":
773
773
  case "lookbehind":
774
774
  return 4 + measureNode(node.body);
@@ -2191,6 +2191,7 @@ var RegexParser = class {
2191
2191
  parseGroup(start) {
2192
2192
  let capturing = true;
2193
2193
  let name;
2194
+ let modifiers;
2194
2195
  let assertionNegated;
2195
2196
  let lookbehind = false;
2196
2197
  if (this.peek() === "?") {
@@ -2212,6 +2213,10 @@ var RegexParser = class {
2212
2213
  } else if (extension.startsWith("?<")) {
2213
2214
  this.position += 2;
2214
2215
  name = this.parseGroupName(start);
2216
+ } else if ("ims-".includes(extension[1] ?? "") && extension.length > 1) {
2217
+ capturing = false;
2218
+ this.position++;
2219
+ modifiers = this.parseModifiers(start);
2215
2220
  } else {
2216
2221
  this.fail("Unsupported group construct", start);
2217
2222
  }
@@ -2240,7 +2245,32 @@ var RegexParser = class {
2240
2245
  return { type: lookbehind ? "lookbehind" : "lookahead", negated: assertionNegated, body };
2241
2246
  }
2242
2247
  this.guard.allocate(5);
2243
- return { type: "group", capturing, index, body, ...name === void 0 ? {} : { name } };
2248
+ return {
2249
+ type: "group",
2250
+ capturing,
2251
+ index,
2252
+ body,
2253
+ ...name === void 0 ? {} : { name },
2254
+ ...modifiers === void 0 ? {} : { modifiers }
2255
+ };
2256
+ }
2257
+ parseModifiers(start) {
2258
+ this.guard.allocate(2);
2259
+ const modifiers = {};
2260
+ let enabled = true;
2261
+ while (!this.atEnd() && this.peek() !== ":") {
2262
+ const flag = this.take();
2263
+ if (flag === "-" && enabled) {
2264
+ enabled = false;
2265
+ continue;
2266
+ }
2267
+ const name = flag === "i" ? "ignoreCase" : flag === "m" ? "multiline" : flag === "s" ? "dotAll" : void 0;
2268
+ if (name === void 0 || Object.hasOwn(modifiers, name)) this.fail("Invalid regex modifiers", start);
2269
+ this.guard.allocate(1);
2270
+ modifiers[name] = enabled;
2271
+ }
2272
+ if (this.take() !== ":" || Object.keys(modifiers).length === 0) this.fail("Invalid regex modifiers", start);
2273
+ return modifiers;
2244
2274
  }
2245
2275
  parseCharacterClass(start) {
2246
2276
  if (this.unicodeSets) return { type: "characterClass", ...this.parseUnicodeSet(start) };
@@ -9738,7 +9768,10 @@ function* matchNode(node, state, context) {
9738
9768
  return;
9739
9769
  }
9740
9770
  case "group":
9741
- for (const result of matchNode(node.body, cloneState(state), context)) {
9771
+ for (const result of matchNode(node.body, cloneState(state), node.modifiers === void 0 ? context : {
9772
+ ...context,
9773
+ flags: { ...context.flags, ...node.modifiers }
9774
+ })) {
9742
9775
  if (!node.capturing || node.index === void 0) {
9743
9776
  yield result;
9744
9777
  continue;
@@ -37567,4 +37600,4 @@ export {
37567
37600
  FileSnapshotBackend,
37568
37601
  run
37569
37602
  };
37570
- //# sourceMappingURL=chunk-OX7524JW.js.map
37603
+ //# sourceMappingURL=chunk-JWZXP3IL.js.map