uniforms-bridge-json-schema
Advanced tools
Comparing version 3.10.1 to 4.0.0-alpha.0
@@ -11,3 +11,3 @@ import { Bridge } from 'uniforms'; | ||
getField(name: string): Record<string, any>; | ||
getInitialValue(name: string, props?: Record<string, any>): any; | ||
getInitialValue(name: string): any; | ||
getProps(name: string, fieldProps?: Record<string, any>): any; | ||
@@ -14,0 +14,0 @@ getSubfields(name?: string): string[]; |
@@ -64,2 +64,3 @@ "use strict"; | ||
this.getField = memoize_1.default(this.getField.bind(this)); | ||
this.getInitialValue = memoize_1.default(this.getInitialValue.bind(this)); | ||
this.getSubfields = memoize_1.default(this.getSubfields.bind(this)); | ||
@@ -163,3 +164,3 @@ this.getType = memoize_1.default(this.getType.bind(this)); | ||
} | ||
getInitialValue(name, props) { | ||
getInitialValue(name) { | ||
var _a; | ||
@@ -172,5 +173,8 @@ const field = this.getField(name); | ||
if (type === 'array') { | ||
const item = this.getInitialValue(uniforms_1.joinName(name, '0')); | ||
const items = (props === null || props === void 0 ? void 0 : props.initialCount) || 0; | ||
return Array.from({ length: items }, () => item); | ||
const item = this.getInitialValue(uniforms_1.joinName(name, '$')); | ||
if (item === undefined) { | ||
return []; | ||
} | ||
const length = (field === null || field === void 0 ? void 0 : field.minItems) || 0; | ||
return Array.from({ length }, () => item); | ||
} | ||
@@ -177,0 +181,0 @@ if (type === 'object') { |
@@ -11,3 +11,3 @@ import { Bridge } from 'uniforms'; | ||
getField(name: string): Record<string, any>; | ||
getInitialValue(name: string, props?: Record<string, any>): any; | ||
getInitialValue(name: string): any; | ||
getProps(name: string, fieldProps?: Record<string, any>): any; | ||
@@ -14,0 +14,0 @@ getSubfields(name?: string): string[]; |
@@ -62,2 +62,3 @@ import { __rest } from "tslib"; | ||
this.getField = memoize(this.getField.bind(this)); | ||
this.getInitialValue = memoize(this.getInitialValue.bind(this)); | ||
this.getSubfields = memoize(this.getSubfields.bind(this)); | ||
@@ -161,3 +162,3 @@ this.getType = memoize(this.getType.bind(this)); | ||
} | ||
getInitialValue(name, props) { | ||
getInitialValue(name) { | ||
var _a; | ||
@@ -170,5 +171,8 @@ const field = this.getField(name); | ||
if (type === 'array') { | ||
const item = this.getInitialValue(joinName(name, '0')); | ||
const items = (props === null || props === void 0 ? void 0 : props.initialCount) || 0; | ||
return Array.from({ length: items }, () => item); | ||
const item = this.getInitialValue(joinName(name, '$')); | ||
if (item === undefined) { | ||
return []; | ||
} | ||
const length = (field === null || field === void 0 ? void 0 : field.minItems) || 0; | ||
return Array.from({ length }, () => item); | ||
} | ||
@@ -175,0 +179,0 @@ if (type === 'object') { |
{ | ||
"name": "uniforms-bridge-json-schema", | ||
"version": "3.10.1", | ||
"version": "4.0.0-alpha.0", | ||
"license": "MIT", | ||
@@ -39,5 +39,5 @@ "main": "./cjs/index.js", | ||
"tslib": "^2.2.0", | ||
"uniforms": "^3.10.1" | ||
"uniforms": "^4.0.0-alpha.0" | ||
}, | ||
"gitHead": "37fa8c1e482cb9c3e8bd6e6395258634366b5d8a" | ||
"gitHead": "94084d3c005b7338d27ed206b67a5a43abba357e" | ||
} |
@@ -95,2 +95,3 @@ import invariant from 'invariant'; | ||
this.getField = memoize(this.getField.bind(this)); | ||
this.getInitialValue = memoize(this.getInitialValue.bind(this)); | ||
this.getSubfields = memoize(this.getSubfields.bind(this)); | ||
@@ -210,3 +211,3 @@ this.getType = memoize(this.getType.bind(this)); | ||
getInitialValue(name: string, props?: Record<string, any>): any { | ||
getInitialValue(name: string): any { | ||
const field = this.getField(name); | ||
@@ -223,5 +224,9 @@ const { | ||
if (type === 'array') { | ||
const item = this.getInitialValue(joinName(name, '0')); | ||
const items = props?.initialCount || 0; | ||
return Array.from({ length: items }, () => item); | ||
const item = this.getInitialValue(joinName(name, '$')); | ||
if (item === undefined) { | ||
return []; | ||
} | ||
const length = field?.minItems || 0; | ||
return Array.from({ length }, () => item); | ||
} | ||
@@ -228,0 +233,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
37926
920
2
+ Addedtslib@2.8.0(transitive)
+ Addeduniforms@4.0.0-beta.4(transitive)
- Removeduniforms@3.10.2(transitive)
Updateduniforms@^4.0.0-alpha.0