uniforms-bridge-simple-schema-2
Advanced tools
Comparing version 3.10.0-rc.0 to 3.10.0-rc.1
@@ -12,5 +12,5 @@ import SimpleSchema from 'simpl-schema'; | ||
getProps(name: string, fieldProps?: Record<string, any>): any; | ||
getSubfields(name?: string): any[]; | ||
getSubfields(name?: string): string[]; | ||
getType(name: string): any; | ||
getValidator(options?: Record<string, any>): (model: Record<string, any>) => any; | ||
} |
@@ -71,3 +71,10 @@ "use strict"; | ||
if (field.type === Object || field.type instanceof simpl_schema_1.default) { | ||
return {}; | ||
const value = {}; | ||
this.getSubfields(name).forEach(key => { | ||
const initialValue = this.getInitialValue(uniforms_1.joinName(name, key)); | ||
if (initialValue !== undefined) { | ||
value[key] = initialValue; | ||
} | ||
}); | ||
return value; | ||
} | ||
@@ -74,0 +81,0 @@ return undefined; |
@@ -12,5 +12,5 @@ import SimpleSchema from 'simpl-schema'; | ||
getProps(name: string, fieldProps?: Record<string, any>): any; | ||
getSubfields(name?: string): any[]; | ||
getSubfields(name?: string): string[]; | ||
getType(name: string): any; | ||
getValidator(options?: Record<string, any>): (model: Record<string, any>) => any; | ||
} |
@@ -69,3 +69,10 @@ import { __rest } from "tslib"; | ||
if (field.type === Object || field.type instanceof SimpleSchema) { | ||
return {}; | ||
const value = {}; | ||
this.getSubfields(name).forEach(key => { | ||
const initialValue = this.getInitialValue(joinName(name, key)); | ||
if (initialValue !== undefined) { | ||
value[key] = initialValue; | ||
} | ||
}); | ||
return value; | ||
} | ||
@@ -72,0 +79,0 @@ return undefined; |
{ | ||
"name": "uniforms-bridge-simple-schema-2", | ||
"version": "3.10.0-rc.0", | ||
"version": "3.10.0-rc.1", | ||
"license": "MIT", | ||
@@ -40,5 +40,5 @@ "main": "./cjs/index.js", | ||
"tslib": "^2.2.0", | ||
"uniforms": "^3.10.0-rc.0" | ||
"uniforms": "^3.10.0-rc.1" | ||
}, | ||
"gitHead": "8331cde56232a721c6e48c09f7049ff77c3b1fa9" | ||
"gitHead": "60b75ade23e43f3d2d06dd6767f35ea9742fb856" | ||
} |
@@ -86,3 +86,10 @@ import invariant from 'invariant'; | ||
if (field.type === Object || field.type instanceof SimpleSchema) { | ||
return {}; | ||
const value: Record<string, unknown> = {}; | ||
this.getSubfields(name).forEach(key => { | ||
const initialValue = this.getInitialValue(joinName(name, key)); | ||
if (initialValue !== undefined) { | ||
value[key] = initialValue; | ||
} | ||
}); | ||
return value; | ||
} | ||
@@ -152,3 +159,3 @@ | ||
getSubfields(name?: string) { | ||
getSubfields(name?: string): string[] { | ||
// @ts-expect-error: Typing for `_makeGeneric` is missing. | ||
@@ -155,0 +162,0 @@ return this.schema.objectKeys(SimpleSchema._makeGeneric(name)); |
25315
618
Updateduniforms@^3.10.0-rc.1