Public
Edited
Sep 17, 2023
Insert cell
Insert cell
z1 = (await importWithMap("zod", importMap)).z
Insert cell
z2 = (await importWithMap("zodDev", importMap)).z
Insert cell
// Value type from different copy of Zod: throws error
z2.record(z2.string(), z1.number()).parse({ "A": 1 })
Insert cell
// Value type from same copy of Zod: no issue
z2.record(z2.string(), z2.number()).parse({ "A": 1 })
Insert cell
// Value type from same copy of Zod: no issue
z1.record(z1.string(), z1.number()).parse({ "A": 1 })
Insert cell
z2.record(z2.string(), z1.number())._def.valueType
Insert cell
importMap = ({
imports: {
"zod": "https://esm.sh/zod@3.21.4",
"zodDev": "https://esm.sh/zod@3.21.4?dev"
},
});
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more