We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73d63d6 commit 9e02622Copy full SHA for 9e02622
src/character-classes/__tests__/any-of.test.ts
@@ -3,6 +3,7 @@ import { oneOrMore } from '../../quantifiers/base';
3
import { anyOf } from '../any-of';
4
5
test('"anyOf" base cases', () => {
6
+ expect(p(anyOf(''))).toBe('');
7
expect(p(anyOf('a'))).toBe('a');
8
expect(p(anyOf('abc'))).toBe('[abc]');
9
});
src/character-classes/compiler.ts
@@ -6,7 +6,7 @@ export function compileCharacterClass({ characters }: CharacterClass): string {
}
if (characters.length === 1) {
- return characters[0] ?? '';
+ return characters[0]!;
10
11
12
return `[${escapeHypen(characters).join('')}]`;
0 commit comments