poe-code 14.0.73 → 14.0.75

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.
Files changed (47) hide show
  1. package/dist/index.js +2732 -1188
  2. package/dist/index.js.map +4 -4
  3. package/dist/metafile.json +1 -1
  4. package/package.json +1 -1
  5. package/packages/safe-js/dist/chunks/{chunk-I2Z37MKZ.js → chunk-BAJI3K4B.js} +2 -2
  6. package/packages/safe-js/dist/chunks/{chunk-XKCTB5FR.js → chunk-EOTY4PCT.js} +2902 -1425
  7. package/packages/safe-js/dist/chunks/chunk-EOTY4PCT.js.map +7 -0
  8. package/packages/safe-js/dist/cli.js +2 -2
  9. package/packages/safe-js/dist/core.js +1 -1
  10. package/packages/safe-js/dist/graph-depth.js +3 -0
  11. package/packages/safe-js/dist/index.js +2 -2
  12. package/packages/safe-js/dist/interp/cancel.js +3 -0
  13. package/packages/safe-js/dist/interp/globals/misc.js +2 -1
  14. package/packages/safe-js/dist/interp/globals/object.js +3 -0
  15. package/packages/safe-js/dist/interp/globals/regex.js +196 -9
  16. package/packages/safe-js/dist/interp/interpreter.js +14 -7
  17. package/packages/safe-js/dist/interp/iteration.js +9 -1
  18. package/packages/safe-js/dist/interp/methods/regex-split.d.ts +3 -0
  19. package/packages/safe-js/dist/interp/methods/regex-split.js +102 -0
  20. package/packages/safe-js/dist/interp/methods/regex.d.ts +8 -4
  21. package/packages/safe-js/dist/interp/methods/regex.js +141 -24
  22. package/packages/safe-js/dist/interp/methods/regexp-iterator.d.ts +12 -0
  23. package/packages/safe-js/dist/interp/methods/regexp-iterator.js +101 -0
  24. package/packages/safe-js/dist/interp/methods/string.d.ts +2 -0
  25. package/packages/safe-js/dist/interp/methods/string.js +415 -121
  26. package/packages/safe-js/dist/interp/object-model.d.ts +3 -0
  27. package/packages/safe-js/dist/interp/object-model.js +43 -10
  28. package/packages/safe-js/dist/interp/regex/compile-guard.js +26 -4
  29. package/packages/safe-js/dist/interp/regex/engine.d.ts +4 -0
  30. package/packages/safe-js/dist/interp/regex/engine.js +230 -30
  31. package/packages/safe-js/dist/interp/regex/parse.d.ts +42 -4
  32. package/packages/safe-js/dist/interp/regex/parse.js +429 -25
  33. package/packages/safe-js/dist/interp/regexp-iterator.d.ts +16 -0
  34. package/packages/safe-js/dist/interp/regexp-iterator.js +23 -0
  35. package/packages/safe-js/dist/interp/string-coercion.js +11 -7
  36. package/packages/safe-js/dist/interp/values.d.ts +2 -1
  37. package/packages/safe-js/dist/interp/values.js +39 -2
  38. package/packages/safe-js/dist/snapshot/dump-format.js +35 -3
  39. package/packages/safe-js/dist/snapshot/replay-data.d.ts +12 -1
  40. package/packages/safe-js/dist/snapshot/replay-data.js +42 -1
  41. package/packages/safe-js/dist/snapshot/replay-inputs.js +17 -0
  42. package/packages/safe-js/dist/snapshot/restore.js +23 -1
  43. package/packages/safe-js/dist/snapshot/serialize.d.ts +13 -2
  44. package/packages/safe-js/dist/snapshot/serialize.js +30 -11
  45. package/packages/safe-js/dist/snapshot/validation.js +22 -2
  46. package/packages/safe-js/dist/chunks/chunk-XKCTB5FR.js.map +0 -7
  47. /package/packages/safe-js/dist/chunks/{chunk-I2Z37MKZ.js.map → chunk-BAJI3K4B.js.map} +0 -0
@@ -1,11 +1,16 @@
1
1
  import { type CompileScope } from "./compile-guard.js";
2
2
  export type RegexFlags = {
3
+ hasIndices: boolean;
3
4
  global: boolean;
5
+ sticky: boolean;
6
+ unicode: boolean;
7
+ unicodeSets: boolean;
4
8
  ignoreCase: boolean;
5
9
  multiline: boolean;
6
10
  dotAll: boolean;
7
11
  };
8
12
  export type CharacterKind = "digit" | "word" | "space";
13
+ type RegexModifiers = Partial<Pick<RegexFlags, "ignoreCase" | "multiline" | "dotAll">>;
9
14
  export type CharacterClassItem = {
10
15
  type: "character";
11
16
  value: string;
@@ -17,12 +22,35 @@ export type CharacterClassItem = {
17
22
  type: "kind";
18
23
  kind: CharacterKind;
19
24
  negated: boolean;
25
+ } | {
26
+ type: "property";
27
+ value: string;
28
+ negated: boolean;
29
+ strings?: boolean;
30
+ } | {
31
+ type: "strings";
32
+ values: string[];
33
+ } | {
34
+ type: "set";
35
+ value: CharacterSet;
36
+ };
37
+ export type CharacterSet = {
38
+ negated: boolean;
39
+ items: CharacterClassItem[];
40
+ operation?: "intersection" | "subtraction";
41
+ strings?: boolean;
20
42
  };
21
43
  export type RegexNode = {
22
44
  type: "empty";
23
45
  } | {
24
46
  type: "literal";
25
47
  value: string;
48
+ } | {
49
+ type: "backreference";
50
+ index: number;
51
+ } | {
52
+ type: "namedBackreference";
53
+ name: string;
26
54
  } | {
27
55
  type: "dot";
28
56
  } | {
@@ -31,11 +59,9 @@ export type RegexNode = {
31
59
  } | {
32
60
  type: "wordBoundary";
33
61
  negated: boolean;
34
- } | {
62
+ } | ({
35
63
  type: "characterClass";
36
- negated: boolean;
37
- items: CharacterClassItem[];
38
- } | {
64
+ } & CharacterSet) | {
39
65
  type: "sequence";
40
66
  elements: RegexNode[];
41
67
  } | {
@@ -45,6 +71,16 @@ export type RegexNode = {
45
71
  type: "group";
46
72
  capturing: boolean;
47
73
  index?: number;
74
+ name?: string;
75
+ modifiers?: RegexModifiers;
76
+ body: RegexNode;
77
+ } | {
78
+ type: "lookahead";
79
+ negated: boolean;
80
+ body: RegexNode;
81
+ } | {
82
+ type: "lookbehind";
83
+ negated: boolean;
48
84
  body: RegexNode;
49
85
  } | {
50
86
  type: "quantifier";
@@ -58,5 +94,7 @@ export type RegexPattern = {
58
94
  flags: RegexFlags;
59
95
  captureCount: number;
60
96
  body: RegexNode;
97
+ groups?: Record<string, number[]>;
61
98
  };
62
99
  export declare function parseRegex(source: string, flags?: string, compilation?: CompileScope, valueUnits?: number): RegexPattern;
100
+ export {};