Created
June 11, 2024 06:13
-
-
Save ThaddeusJiang/09bd33637327daac4134786bced0a0b7 to your computer and use it in GitHub Desktop.
JavaScript single-file application
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
// install npm package | |
async function install() { | |
const z = await import("zod") | |
return { z } | |
} | |
async function main() { | |
const { z } = await install() | |
const result = z.string().datetime().safeParse("2021-01-01T00:00:00Z") | |
console.log(result) | |
} | |
main() | |
// { | |
// success: true, | |
// data: "2021-01-01T00:00:00Z" | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment