clarity-pattern-parser 10.0.1 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clarity-pattern-parser",
3
- "version": "10.0.1",
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;