File tree Expand file tree Collapse file tree 4 files changed +22
-16
lines changed Expand file tree Collapse file tree 4 files changed +22
-16
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,6 @@ async function main() {
24
24
/ (?: ^ | \/ | \\ ) .+ \. d \. t s $ / . test ( libFile )
25
25
) ;
26
26
27
- // copy special "util" file
28
- const utilFile = path . join ( betterLibDir , "lib.util.d.ts" ) ;
29
- await writeFile (
30
- path . join ( distDir , "lib.util.d.ts" ) ,
31
- await readFile ( utilFile , "utf8" )
32
- ) ;
33
-
34
27
// modify each lib file
35
28
for ( const libFile of libFiles ) {
36
29
const tsLibFile = path . join ( tsLibDir , libFile ) ;
Original file line number Diff line number Diff line change 1
1
/// <reference no-default-lib="true" />
2
- /// <reference lib="util" />
2
+
3
+ // -----------
4
+ // additional utility types
5
+ type UnionToIntersection < T > = (
6
+ T extends any ? ( arg : T ) => void : never
7
+ ) extends ( arg : infer F ) => void
8
+ ? F
9
+ : unknown ;
10
+
11
+ type Awaited < T > = T extends PromiseLike < infer U > ? Awaited < U > : T ;
12
+ // -----------
3
13
4
14
/**
5
15
* Evaluates JavaScript code and executes it.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
/// <reference no-default-lib="true" />
2
- /// <reference lib="util" />
2
+
3
+ // -----------
4
+ // additional utility types
5
+ type UnionToIntersection < T > = (
6
+ T extends any ? ( arg : T ) => void : never
7
+ ) extends ( arg : infer F ) => void
8
+ ? F
9
+ : unknown ;
10
+
11
+ type Awaited < T > = T extends PromiseLike < infer U > ? Awaited < U > : T ;
12
+ // -----------
3
13
4
14
/**
5
15
* Evaluates JavaScript code and executes it.
You can’t perform that action at this time.
0 commit comments