Skip to content

Commit d391cbe

Browse files
committed
Upgrade engine
1 parent aa0262f commit d391cbe

File tree

3 files changed

+166
-236
lines changed

3 files changed

+166
-236
lines changed

components/state-tree.tsx

+1-47
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,7 @@
11
import { useRef, useEffect } from 'react';
22
import * as d3 from 'd3';
33
// @ts-ignore-error
4-
// import { debugPrint } from '@iter-tools/regex/internal/debug';
5-
6-
const _debugPrint = (matcher: any, sentinel: any): string | null => {
7-
if (matcher === null) return null;
8-
9-
let m = matcher;
10-
let str = '';
11-
while (m !== null) {
12-
if (typeof matcher.match !== 'function') {
13-
throw new Error('debugPrint can only print matchers.');
14-
}
15-
16-
switch (m.name) {
17-
case 'literal':
18-
str += m.value;
19-
break;
20-
case 'boundaryAssertion':
21-
str += '\\b';
22-
break;
23-
case 'edgeAssertion':
24-
str += m.kind === 'start' ? '^' : '$';
25-
break;
26-
case 'expression':
27-
str += `(${m.matchers.map((m: any) => _debugPrint(m, sentinel)).join('|')})`;
28-
break;
29-
case 'repeat':
30-
if (m.repeatCont.name !== 'unmatched') {
31-
str += `(${m.exprCont.seqs
32-
.map((m: any) => _debugPrint(m, m.next))
33-
.filter(Boolean)
34-
.join('|')})*`;
35-
}
36-
break;
37-
default:
38-
break;
39-
}
40-
41-
if (m.next === sentinel) {
42-
return str === '' ? null : str;
43-
} else {
44-
m = m.next;
45-
}
46-
}
47-
return str;
48-
};
49-
50-
const debugPrint = (matcher: any) => _debugPrint(matcher, null);
4+
import { debugPrint } from '@iter-tools/regex/internal/debug';
515

526
export const useD3 = (render, dependencies) => {
537
const ref = useRef(null);

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"@iter-tools/regex": "iter-tools/regex#1c641e479857d0d33020629c16953297c4a277b2",
12+
"@iter-tools/regex": "iter-tools/regex#9bab6c40e70141252bac88aae8ecf1debb51c37a",
1313
"d3": "^7.4.2",
1414
"grommet": "^2.17.2",
1515
"grommet-icons": "^4.5.0",

0 commit comments

Comments
 (0)