Skip to content

Commit c73c2ed

Browse files
authored
feat: add not.word helper input (#282)
1 parent 5172d2b commit c73c2ed

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/core/inputs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const linefeed = createInput('\\n')
4646
export const carriageReturn = createInput('\\r')
4747

4848
export const not = {
49+
word: createInput('\\W+'),
4950
wordChar: createInput('\\W'),
5051
wordBoundary: createInput('\\B'),
5152
digit: createInput('\\D'),

test/inputs.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ describe('inputs', () => {
146146
expectTypeOf(extractRegExp(input)).toEqualTypeOf<'\\r'>()
147147
})
148148
it('not', () => {
149+
expect(not.word.toString()).toMatchInlineSnapshot('"\\\\W+"')
150+
expectTypeOf(extractRegExp(not.word)).toEqualTypeOf<'\\W+'>()
149151
expect(not.wordChar.toString()).toMatchInlineSnapshot('"\\\\W"')
150152
expectTypeOf(extractRegExp(not.wordChar)).toEqualTypeOf<'\\W'>()
151153
expect(not.wordBoundary.toString()).toMatchInlineSnapshot('"\\\\B"')

0 commit comments

Comments
 (0)