Created
August 26, 2022 10:57
-
-
Save minodisk/c440ae556d89c3b231dbfc9b3e4078a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { generate } from "ts-to-zod"; | |
import clipboard from "clipboardy"; | |
(async () => { | |
const sourceText = await clipboard.read(); | |
const schema = generate({ | |
sourceText, | |
}) | |
.getZodSchemasFile() | |
.replace("// Generated by ts-to-zod\n", ""); | |
await clipboard.write(schema); | |
process.stdout.write("Copy zod schema to clipboard.\n"); | |
process.exit(0); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment