Skip to content

Commit 9e02622

Browse files
committed
refactor: improve code cov
1 parent 73d63d6 commit 9e02622

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/character-classes/__tests__/any-of.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { oneOrMore } from '../../quantifiers/base';
33
import { anyOf } from '../any-of';
44

55
test('"anyOf" base cases', () => {
6+
expect(p(anyOf(''))).toBe('');
67
expect(p(anyOf('a'))).toBe('a');
78
expect(p(anyOf('abc'))).toBe('[abc]');
89
});

src/character-classes/compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function compileCharacterClass({ characters }: CharacterClass): string {
66
}
77

88
if (characters.length === 1) {
9-
return characters[0] ?? '';
9+
return characters[0]!;
1010
}
1111

1212
return `[${escapeHypen(characters).join('')}]`;

0 commit comments

Comments
 (0)