Skip to content

Commit

Permalink
feat: add meta schema
Browse files Browse the repository at this point in the history
Also:
- Make object's `properties` optional
- Add `symbol` to SzKey
  • Loading branch information
brettz9 committed Jul 13, 2024
1 parent 9fafb66 commit d2c40aa
Show file tree
Hide file tree
Showing 6 changed files with 939 additions and 193 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/schema.zodex
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"check-style": "prettier --check src",
"lint": "eslint src/**",
"test": "vitest --coverage --silent=false --reporter=basic",
"build": "rm -rf dist && pnpm tsc",
"build": "rm -rf dist && pnpm tsc && cp src/schema.zodex dist/schema.zodex",
"prepublish": "pnpm run build"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/dezerialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ const dezerializers = {
object: ((shape: SzObject, opts: DezerializerOptions) => {
let i = z.object(
Object.fromEntries(
Object.entries(shape.properties).map(([key, value]) => {
Object.entries(shape.properties ?? {}).map(([key, value]) => {
return [
key,
checkRef(value, opts) ||
Expand Down
Loading

0 comments on commit d2c40aa

Please sign in to comment.