@poe-platform/safe-js 0.1.193 → 0.1.194

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-IBLBXKUC.js";
30
+ } from "./chunk-WRASETAY.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-2N7Z7ETR.js.map
8252
+ //# sourceMappingURL=chunk-CU4ESS5Q.js.map
@@ -756,6 +756,8 @@ function measureNode(node) {
756
756
  }
757
757
  case "group":
758
758
  return 5 + measureNode(node.body);
759
+ case "lookahead":
760
+ return 4 + measureNode(node.body);
759
761
  case "quantifier":
760
762
  return (Object.hasOwn(node, "max") ? 6 : 5) + measureNode(node.body);
761
763
  }
@@ -2162,6 +2164,7 @@ var RegexParser = class {
2162
2164
  }
2163
2165
  parseGroup(start) {
2164
2166
  let capturing = true;
2167
+ let lookahead;
2165
2168
  if (this.peek() === "?") {
2166
2169
  this.guard.allocate(Math.min(3, this.source.length - this.position));
2167
2170
  this.guard.work(Math.min(3, this.source.length - this.position));
@@ -2170,7 +2173,9 @@ var RegexParser = class {
2170
2173
  capturing = false;
2171
2174
  this.position += 2;
2172
2175
  } else if (extension.startsWith("?=") || extension.startsWith("?!")) {
2173
- this.fail("Lookahead is not supported", start);
2176
+ capturing = false;
2177
+ lookahead = extension.startsWith("?!");
2178
+ this.position += 2;
2174
2179
  } else if (extension.startsWith("?<=") || extension.startsWith("?<!")) {
2175
2180
  this.fail("Lookbehind is not supported", start);
2176
2181
  } else if (extension.startsWith("?<")) {
@@ -2192,6 +2197,10 @@ var RegexParser = class {
2192
2197
  this.fail("Unterminated group", start);
2193
2198
  }
2194
2199
  this.position += 1;
2200
+ if (lookahead !== void 0) {
2201
+ this.guard.allocate(4);
2202
+ return { type: "lookahead", negated: lookahead, body };
2203
+ }
2195
2204
  this.guard.allocate(5);
2196
2205
  return { type: "group", capturing, index, body };
2197
2206
  }
@@ -9369,6 +9378,15 @@ function* matchNode(node, state, context) {
9369
9378
  yield* matchNode(alternative, cloneState(state), context);
9370
9379
  }
9371
9380
  return;
9381
+ case "lookahead": {
9382
+ const result = matchNode(node.body, cloneState(state), context).next();
9383
+ if (node.negated) {
9384
+ if (result.done) yield state;
9385
+ } else if (!result.done) {
9386
+ yield { position: state.position, captures: result.value.captures };
9387
+ }
9388
+ return;
9389
+ }
9372
9390
  case "group":
9373
9391
  for (const result of matchNode(node.body, cloneState(state), context)) {
9374
9392
  if (!node.capturing || node.index === void 0) {
@@ -9493,7 +9511,7 @@ function clearNodeCaptures(node, captures) {
9493
9511
  }
9494
9512
  return;
9495
9513
  }
9496
- if (node.type === "quantifier") {
9514
+ if (node.type === "quantifier" || node.type === "lookahead") {
9497
9515
  clearNodeCaptures(node.body, captures);
9498
9516
  }
9499
9517
  }
@@ -37083,4 +37101,4 @@ export {
37083
37101
  FileSnapshotBackend,
37084
37102
  run
37085
37103
  };
37086
- //# sourceMappingURL=chunk-IBLBXKUC.js.map
37104
+ //# sourceMappingURL=chunk-WRASETAY.js.map