diff --git a/src/core/flags.ts b/src/core/flags.ts index d43b569b..b887eae1 100644 --- a/src/core/flags.ts +++ b/src/core/flags.ts @@ -3,22 +3,22 @@ export type Flag = 'd' | 'g' | 'i' | 'm' | 's' | 'u' | 'y' /** Generate indices for substring matches */ -export const withIndices: Flag = 'd' +export const withIndices = 'd' /** Case-insensitive search */ -export const caseInsensitive: Flag = 'i' +export const caseInsensitive = 'i' /** Global search */ -export const global: Flag = 'g' +export const global = 'g' /** Multi-line search */ -export const multiline: Flag = 'm' +export const multiline = 'm' /** Allows `.` to match newline characters */ -export const dotAll: Flag = 's' +export const dotAll = 's' /** Treat a pattern as a sequence of unicode code points */ -export const unicode: Flag = 'u' +export const unicode = 'u' /** Perform a "sticky" search that matches starting at the current position in the target string */ -export const sticky: Flag = 'y' +export const sticky = 'y' diff --git a/test/flags.test.ts b/test/flags.test.ts new file mode 100644 index 00000000..9a2840ef --- /dev/null +++ b/test/flags.test.ts @@ -0,0 +1,12 @@ +import { it, describe } from 'vitest' +import { expectTypeOf } from 'expect-type' +import * as flags from '../src/core/flags' +import type { Flag } from '../src/core/flags' + +type ValueOf = T[keyof T] + +describe('flags', () => { + it('are all present', () => { + expectTypeOf().toMatchTypeOf>() + }) +})