Skip to content
This repository was archived by the owner on Oct 20, 2021. It is now read-only.

Commit 687ae1f

Browse files
fix(rules): Added all consonants
1 parent d9ad29d commit 687ae1f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/rules/consonant.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { AbstractFilter } from './abstract-filter';
2-
import { Regex } from './regex';
32

43
export class Consonant extends AbstractFilter {
54

65
/**
76
* Validate Clean.
87
*/
98
public validateClean(input: string): boolean {
10-
return new Regex(/^(\s|[b-df-hj-np-tv-zB-DF-HJ-NP-TV-Z])*$/).validate(input);
9+
return /^(\s|[bcdfghjklmnpqrstvwxyz])*$/i.test(input);
1110
}
1211
}

test/rules/consonant.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ describe('Consonant', () => {
2929
assert.isTrue(consonant.validate('y'));
3030
assert.isTrue(consonant.validate('bcdfghklmnp'));
3131
assert.isTrue(consonant.validate('bcdfghklm np'));
32+
assert.isTrue(consonant.validate('bcdfghjklmnpqrstvwxyz'));
3233
assert.isTrue(consonant.validate('qrst'));
3334
assert.isTrue(consonant.validate('\nz\t'));
3435
});

0 commit comments

Comments
 (0)