We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23515c7 commit de83ea2Copy full SHA for de83ea2
1 file changed
src/compiler.ts
@@ -49,5 +49,11 @@ function compileSingle(elements: RegexElement): string {
49
return elementCompiler(compiledChildren);
50
}
51
52
- return characterClasses[elements.type];
+ const characterCompiler = characterClasses[elements.type];
53
+
54
+ if (!characterCompiler) {
55
+ throw new Error(`Unknown character type ${elements.type}`);
56
+ }
57
58
+ return characterCompiler;
59
0 commit comments