From 2c7940f709994622ed958685370c371e13ca2458 Mon Sep 17 00:00:00 2001 From: Lexus Drumgold Date: Fri, 15 Oct 2021 13:43:41 -0400 Subject: [PATCH] feat(types): `RegexString` --- src/types/index.ts | 1 + src/types/regex-string.type.ts | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 src/types/regex-string.type.ts diff --git a/src/types/index.ts b/src/types/index.ts index 887ed7b9..0c8fd96a 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -50,5 +50,6 @@ export type { default as PathValue } from './path-value.type' export type { default as Path } from './path.type' export type { default as PickByType } from './pick-by-type.type' export type { default as Primitive } from './primitive.type' +export type { default as RegexString } from './regex-string.type' export type { default as Split } from './split.type' export type { default as Union } from './union.type' diff --git a/src/types/regex-string.type.ts b/src/types/regex-string.type.ts new file mode 100644 index 00000000..1e7fd9ce --- /dev/null +++ b/src/types/regex-string.type.ts @@ -0,0 +1,11 @@ +/** + * @file Type Definitions - RegexString + * @module tutils/types/RegexString + */ + +/** + * Value that can be a `RegExp` object or string literal. + */ +type RegexString = RegExp | string + +export default RegexString