Skip to content

Commit

Permalink
feat(types): OrNil, OrNull, OrUndefined
Browse files Browse the repository at this point in the history
  • Loading branch information
unicornware committed Nov 12, 2021
1 parent 2ae7467 commit 23ea43e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ export type { default as OmitByType } from './omit-by-type.type'
export type { default as OneOrMany } from './one-or-many.type'
export type { default as OrDeepPartial } from './or-deep-partial.type'
export type { default as OrNever } from './or-never.type'
export type { default as OrNil } from './or-nil.type'
export type { default as OrNull } from './or-null.type'
export type { default as OrPartial } from './or-partial.type'
export type { default as OrPromise } from './or-promise.type'
export type { default as OrUndefined } from './or-undefined.type'
export type { default as Overwrite } from './overwrite.type'
export type { default as PartialByRequired } from './partial-by-required.type'
export type { default as PartialBy } from './partial-by.type'
Expand Down
15 changes: 15 additions & 0 deletions src/types/or-nil.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type NIL from './nil.type'

/**
* @file Type Definitions - OrNil
* @module tutils/types/OrNil
*/

/**
* Type representing a value that also be `NIL`.
*
* @template T - Value type
*/
type OrNil<T> = T | NIL

export default OrNil
13 changes: 13 additions & 0 deletions src/types/or-null.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* @file Type Definitions - OrNull
* @module tutils/types/OrNull
*/

/**
* Type representing a value that also be `null`.
*
* @template T - Value type
*/
type OrNull<T> = T | null

export default OrNull
13 changes: 13 additions & 0 deletions src/types/or-undefined.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* @file Type Definitions - OrUndefined
* @module tutils/types/OrUndefined
*/

/**
* Type representing a value that also be `undefined`.
*
* @template T - Value type
*/
type OrUndefined<T> = T | undefined

export default OrUndefined

0 comments on commit 23ea43e

Please sign in to comment.