Skip to content

Commit

Permalink
Bump min TS version to 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhacks committed Dec 10, 2024
1 parent 0c6cbbd commit 4e219d6
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
node: ["latest"]
typescript: ["4.5", "4.6", "4.7", "4.8", "4.9", "5.0", "5.3"]
typescript: ["5.0", "latest"]
name: Test with TypeScript ${{ matrix.typescript }} on Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 1 addition & 2 deletions deno/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ export abstract class ZodType<
Output = any,
Def extends ZodTypeDef = ZodTypeDef,
Input = Output
> implements StandardSchemaV1<Input, Output>
{
> {
readonly _type!: Output;
readonly _output!: Output;
readonly _input!: Input;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"ts-node": "^10.9.1",
"tslib": "^2.3.1",
"tsx": "^3.8.0",
"typescript": "~4.5.5",
"typescript": "^5.0.0",
"vitest": "^0.32.2"
},
"exports": {
Expand Down
13 changes: 0 additions & 13 deletions playground.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
import { z } from "./src";

z;

const schema = z
.string()
.transform((input) => input || undefined)
.optional()
.default("default");

type Input = z.input<typeof schema>; // string | undefined
type Output = z.output<typeof schema>; // string

const result = schema.safeParse("");

console.log(result); // { success: true, data: undefined }
3 changes: 1 addition & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ export abstract class ZodType<
Output = any,
Def extends ZodTypeDef = ZodTypeDef,
Input = Output
> implements StandardSchemaV1<Input, Output>
{
> {
readonly _type!: Output;
readonly _output!: Output;
readonly _input!: Input;
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11638,11 +11638,6 @@ typescript@^5.0.0, typescript@^5.4.4:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611"
integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==

typescript@~4.5.5:
version "4.5.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"
integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==

ufo@^1.3.2:
version "1.4.0"
resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.4.0.tgz#39845b31be81b4f319ab1d99fd20c56cac528d32"
Expand Down

0 comments on commit 4e219d6

Please sign in to comment.