Skip to content

Commit

Permalink
fix: do not drop dict key with simplify, fix koishijs/webui#306
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Mar 17, 2024
1 parent 0de846e commit e53aeff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
@@ -1,7 +1,7 @@
{
"name": "schemastery",
"description": "Type driven schema validator",
"version": "3.14.3",
"version": "3.14.4",
"main": "lib/index.cjs",
"module": "lib/index.mjs",
"typings": "lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Expand Up @@ -289,7 +289,7 @@ Schema.prototype.simplify = function simplify(this: Schema, value) {
for (const key in value) {
const schema = this.type === 'object' ? this.dict![key] : this.inner
const item = schema?.simplify(value[key])
if (!isNullable(item)) result[key] = item
if (this.type === 'dict' || !isNullable(item)) result[key] = item
}
return result
} else if (this.type === 'array' || this.type === 'tuple') {
Expand Down
4 changes: 2 additions & 2 deletions packages/form/package.json
@@ -1,7 +1,7 @@
{
"name": "schemastery-vue",
"description": "Type driven schema validator",
"version": "7.3.1",
"version": "7.3.2",
"main": "src/index.ts",
"files": [
"src"
Expand All @@ -23,6 +23,6 @@
"vue": "^3"
},
"dependencies": {
"schemastery": "^3.14.3"
"schemastery": "^3.14.4"
}
}

0 comments on commit e53aeff

Please sign in to comment.