New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

uniforms-bridge-json-schema

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uniforms-bridge-json-schema - npm Package Compare versions

Comparing version 3.10.1 to 4.0.0-alpha.0

2

cjs/JSONSchemaBridge.d.ts

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc