Skip to content

Commit 643cede

Browse files
fix: crash with ERR_REQUIRE_ESM error (#240)
1 parent 5d04a6d commit 643cede

File tree

6 files changed

+839
-1256
lines changed

6 files changed

+839
-1256
lines changed

declarations/utils.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
/**
2+
* @template T
3+
* @param {T} value
4+
* @return {
5+
T extends (null | undefined)
6+
? []
7+
: T extends string
8+
? [string]
9+
: T extends readonly unknown[]
10+
? T
11+
: T extends Iterable<infer T>
12+
? T[]
13+
: [T]
14+
}
15+
*/
16+
export function arrify<T>(
17+
value: T
18+
): T extends null | undefined
19+
? []
20+
: T extends string
21+
? [string]
22+
: T extends readonly unknown[]
23+
? T
24+
: T extends Iterable<infer T_1>
25+
? T_1[]
26+
: [T];
127
/**
228
* @param {string|string[]} files
329
* @param {string} context

0 commit comments

Comments
 (0)