clarity-pattern-parser 10.0.0 → 10.0.2

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.
@@ -17,7 +17,7 @@ export declare class Regex implements Pattern {
17
17
  get id(): string;
18
18
  get type(): string;
19
19
  get name(): string;
20
- get value(): string;
20
+ get regex(): string;
21
21
  get parent(): Pattern | null;
22
22
  set parent(pattern: Pattern | null);
23
23
  get children(): Pattern[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clarity-pattern-parser",
3
- "version": "10.0.0",
3
+ "version": "10.0.2",
4
4
  "description": "Parsing Library for Typescript and Javascript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.esm.js",
@@ -117,7 +117,7 @@ export class FiniteRepeat implements Pattern {
117
117
  }
118
118
 
119
119
  if (this._trimDivider && this._hasDivider) {
120
- const isDividerLastMatch = cursor.leafMatch.pattern === this.children[1];
120
+ const isDividerLastMatch = cursor.leafMatch.pattern?.id === this.children[1].id;
121
121
  if (isDividerLastMatch) {
122
122
  const node = nodes.pop() as Node;
123
123
  cursor.moveTo(node.firstIndex);
@@ -196,7 +196,7 @@ export class InfiniteRepeat implements Pattern {
196
196
  if (dividerNode == null) {
197
197
  cursor.moveTo(dividerStartIndex);
198
198
 
199
- if (dividerNode == null && repeatNode == null) {
199
+ if (repeatNode == null) {
200
200
  // If neither the repeat pattern or divider pattern matched get out.
201
201
  passed = true;
202
202
  break;
@@ -30,7 +30,7 @@ export class Regex implements Pattern {
30
30
  return this._name;
31
31
  }
32
32
 
33
- get value(): string{
33
+ get regex(): string{
34
34
  return this._originalRegexString;
35
35
  }
36
36