Skip to content

Commit 4e219d6

Browse files
committedDec 10, 2024·
Bump min TS version to 5.0
1 parent 0c6cbbd commit 4e219d6

File tree

6 files changed

+4
-24
lines changed

6 files changed

+4
-24
lines changed
 

‎.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
node: ["latest"]
17-
typescript: ["4.5", "4.6", "4.7", "4.8", "4.9", "5.0", "5.3"]
17+
typescript: ["5.0", "latest"]
1818
name: Test with TypeScript ${{ matrix.typescript }} on Node ${{ matrix.node }}
1919
steps:
2020
- uses: actions/checkout@v4

‎deno/lib/types.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ export abstract class ZodType<
170170
Output = any,
171171
Def extends ZodTypeDef = ZodTypeDef,
172172
Input = Output
173-
> implements StandardSchemaV1<Input, Output>
174-
{
173+
> {
175174
readonly _type!: Output;
176175
readonly _output!: Output;
177176
readonly _input!: Input;

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"ts-node": "^10.9.1",
4545
"tslib": "^2.3.1",
4646
"tsx": "^3.8.0",
47-
"typescript": "~4.5.5",
47+
"typescript": "^5.0.0",
4848
"vitest": "^0.32.2"
4949
},
5050
"exports": {

‎playground.ts

-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
11
import { z } from "./src";
22

33
z;
4-
5-
const schema = z
6-
.string()
7-
.transform((input) => input || undefined)
8-
.optional()
9-
.default("default");
10-
11-
type Input = z.input<typeof schema>; // string | undefined
12-
type Output = z.output<typeof schema>; // string
13-
14-
const result = schema.safeParse("");
15-
16-
console.log(result); // { success: true, data: undefined }

‎src/types.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ export abstract class ZodType<
170170
Output = any,
171171
Def extends ZodTypeDef = ZodTypeDef,
172172
Input = Output
173-
> implements StandardSchemaV1<Input, Output>
174-
{
173+
> {
175174
readonly _type!: Output;
176175
readonly _output!: Output;
177176
readonly _input!: Input;

‎yarn.lock

-5
Original file line numberDiff line numberDiff line change
@@ -11638,11 +11638,6 @@ typescript@^5.0.0, typescript@^5.4.4:
1163811638
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611"
1163911639
integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==
1164011640

11641-
typescript@~4.5.5:
11642-
version "4.5.5"
11643-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"
11644-
integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==
11645-
1164611641
ufo@^1.3.2:
1164711642
version "1.4.0"
1164811643
resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.4.0.tgz#39845b31be81b4f319ab1d99fd20c56cac528d32"

1 commit comments

Comments
 (1)

Natana-beep commented on Dec 27, 2024

@Natana-beep
Please sign in to comment.