Skip to content

Commit 9d030b7

Browse files
committed
fix: revert Nullable
1 parent eccda4c commit 9d030b7

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/array.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Arrayable, Nullable } from './types'
33
/**
44
* Convert Arrayable<T> to Array<T>
55
*/
6-
export function toArray<T>(array: Nullable<Arrayable<T>>): Array<T> {
6+
export function toArray<T>(array?: Nullable<Arrayable<T>>): Array<T> {
77
array = array || []
88
if (Array.isArray(array))
99
return array
@@ -13,7 +13,7 @@ export function toArray<T>(array: Nullable<Arrayable<T>>): Array<T> {
1313
/**
1414
* Convert Arrayable<T> to Array<T>
1515
*/
16-
export function flattenArrayable<T>(array: Nullable<Arrayable<T | Array<T>>>): Array<T> {
16+
export function flattenArrayable<T>(array?: Nullable<Arrayable<T | Array<T>>>): Array<T> {
1717
return toArray(array).flat(1) as Array<T>
1818
}
1919

src/types.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,10 @@
33
*/
44
export type Awaitable<T> = T | PromiseLike<T>
55

6-
/**
7-
* Null or underfind whatever
8-
*/
9-
export type Nilable<T> = T | null | undefined
10-
116
/**
127
* Null or whatever
138
*/
14-
export type Nullable<T> = T | null
15-
16-
/**
17-
* Undefined or whatever
18-
*/
19-
export type Undefineable<T> = T | undefined
9+
export type Nullable<T> = T | null | undefined
2010

2111
/**
2212
* Array, or not yet

0 commit comments

Comments
 (0)