@onetyped/zod
Advanced tools
Comparing version 1.0.1-canary.980a702llc8 to 1.0.1
@@ -25,2 +25,3 @@ // src/from-schema.ts | ||
unknown, | ||
UnsupportedError, | ||
voidType | ||
@@ -127,3 +128,3 @@ } from "@onetyped/core"; | ||
default: { | ||
throw new Error(`Unsupported type: ${typeName}`); | ||
throw new UnsupportedError("zod", typeName); | ||
} | ||
@@ -310,2 +311,5 @@ } | ||
} | ||
case "circular": { | ||
return z2.unknown(); | ||
} | ||
} | ||
@@ -316,7 +320,6 @@ }; | ||
import { | ||
createUnstableStringGuard, | ||
mapMultipleInnerNode as mapMultipleInnerNode2, | ||
mapObjectNode as mapObjectNode2, | ||
serializePrimitive, | ||
UnsupportedError | ||
UnsupportedError as UnsupportedError2 | ||
} from "@onetyped/core"; | ||
@@ -389,6 +392,3 @@ var createZodMethod = (method, argument_) => { | ||
case "object": { | ||
const unstableStringGuard = createUnstableStringGuard(); | ||
const propertySchemas = mapObjectNode2(node, toZodString).map( | ||
([key, zodType]) => `${JSON.stringify(unstableStringGuard(key))}: ${zodType}` | ||
).join(", "); | ||
const propertySchemas = mapObjectNode2(node, toZodString).map(([key, zodType]) => `${JSON.stringify(key)}: ${zodType}`).join(", "); | ||
return createZodMethod("object", `{ ${propertySchemas} }`); | ||
@@ -448,4 +448,7 @@ } | ||
case "named": { | ||
throw new UnsupportedError("zod", "named"); | ||
throw new UnsupportedError2("zod", "named"); | ||
} | ||
case "circular": { | ||
throw new UnsupportedError2("zod", "circular"); | ||
} | ||
} | ||
@@ -452,0 +455,0 @@ }; |
{ | ||
"name": "@onetyped/zod", | ||
"version": "1.0.1-canary.980a702llc8", | ||
"version": "1.0.1", | ||
"type": "module", | ||
@@ -44,5 +44,5 @@ "description": "onetyped Zod integration", | ||
"devDependencies": { | ||
"@onetyped/core": "0.1.0", | ||
"@trpc-labs/eslint-config": "0.1.1", | ||
"@trpc-labs/tsconfig": "0.1.1", | ||
"@onetyped/core": "0.1.1", | ||
"@trpc-labs/eslint-config": "0.1.2", | ||
"@trpc-labs/tsconfig": "0.1.2", | ||
"@trpc-labs/tsup-config": "0.1.0", | ||
@@ -49,0 +49,0 @@ "tsup": "6.7.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
31135
915
0