Skip to content

Commit a9cd889

Browse files
committed
Use TypeScript 6 across all projects
1 parent 943a58b commit a9cd889

5 files changed

Lines changed: 9 additions & 44 deletions

File tree

packages/openapi-fetch/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"openapi-typescript-codegen": "0.30.0",
7272
"openapi-typescript-fetch": "2.2.1",
7373
"superagent": "10.3.0",
74-
"typescript": "5.9.3",
74+
"typescript": "catalog:",
7575
"undici": "7.25.0",
7676
"vite": "catalog:"
7777
}

packages/openapi-fetch/test/helpers.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ export function createObservedClient<T extends {}, M extends MediaType = MediaTy
2727
* Convert a Headers object to a plain object for easier comparison
2828
*/
2929
export function headersToObj(headers: Headers | Record<string, string>): Record<string, string> {
30-
const iter =
31-
headers instanceof Headers
32-
? headers
33-
// @ts-expect-error FIXME: this is a missing "lib" in tsconfig.json but dunno what
34-
.entries()
35-
: Object.entries(headers);
30+
// Headers is iterable at runtime in both TS 5 and TS 6, but the lib type only
31+
// declares Iterable in TS 6's lib.dom. Double-cast bridges the gap.
32+
const entries =
33+
headers instanceof Headers ? Array.from(headers as unknown as Iterable<[string, string]>) : Object.entries(headers);
3634
const result: Record<string, string> = {};
37-
for (const [k, v] of iter) {
35+
for (const [k, v] of entries) {
3836
result[k] = v;
3937
}
4038
return result;

packages/openapi-fetch/test/no-strict-null-checks/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4+
"rootDir": "../..",
45
"strictNullChecks": false
56
},
67
"include": ["."],

packages/openapi-fetch/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"compilerOptions": {
33
"allowSyntheticDefaultImports": true,
44
"declaration": true,
5-
"downlevelIteration": false,
65
"esModuleInterop": true,
76
"lib": ["ESNext", "DOM"],
87
"module": "NodeNext",

pnpm-lock.yaml

Lines changed: 2 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)