Skip to content

Commit a3a52ba

Browse files
committed
fix: remove "util" lib as not supported
1 parent e4cbebe commit a3a52ba

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

build/build.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ async function main() {
2424
/(?:^|\/|\\).+\.d\.ts$/.test(libFile)
2525
);
2626

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-
3427
// modify each lib file
3528
for (const libFile of libFiles) {
3629
const tsLibFile = path.join(tsLibDir, libFile);

generated/lib.es5.d.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
/// <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+
// -----------
313

414
/**
515
* Evaluates JavaScript code and executes it.

generated/lib.util.d.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

lib/lib.es5.d.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
/// <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+
// -----------
313

414
/**
515
* Evaluates JavaScript code and executes it.

0 commit comments

Comments
 (0)