@xuda.io/xuda-studio-checker 1.0.18 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +5 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3944,7 +3944,7 @@ export const get_zod_schema = function (type) {
|
|
|
3944
3944
|
return XudaComponentSchema;
|
|
3945
3945
|
};
|
|
3946
3946
|
|
|
3947
|
-
export const get_fields_z_schema = function (fields = {}, exclude_props = []) {
|
|
3947
|
+
export const get_fields_z_schema = function (fields = {}, exclude_props = [], data = {}) {
|
|
3948
3948
|
let inputSchema = {};
|
|
3949
3949
|
|
|
3950
3950
|
const get_z_item = function (key, val) {
|
|
@@ -3972,6 +3972,10 @@ export const get_fields_z_schema = function (fields = {}, exclude_props = []) {
|
|
|
3972
3972
|
_z = z.enum(val.enum);
|
|
3973
3973
|
}
|
|
3974
3974
|
|
|
3975
|
+
if (data[item_key]) {
|
|
3976
|
+
_z = z.default(data[item_key]);
|
|
3977
|
+
}
|
|
3978
|
+
|
|
3975
3979
|
let valid_values = '';
|
|
3976
3980
|
if (val.options) {
|
|
3977
3981
|
valid_values = val.options.join(', ');
|