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 4.0.0-alpha.3 to 4.0.0-alpha.4

19

cjs/JSONSchemaBridge.js

@@ -227,15 +227,14 @@ "use strict";

}
const options = props.options;
let options = props.options;
if (options) {
if (Array.isArray(options)) {
props.allowedValues = options.map(option => option.value);
props.transform = (value) => options.find(option => option.value === value).label;
if (!Array.isArray(options)) {
options = Object.entries(options).map(([key, value]) => ({
key,
label: key,
value,
}));
}
else {
props.allowedValues = Object.keys(options);
props.transform = (value) => options[value];
}
}
else if (props.enum) {
props.allowedValues = props.enum;
options = Object.values(props.enum).map(value => ({ value }));
}

@@ -253,3 +252,3 @@ propsToRename.forEach(([key, newKey]) => {

});
return props;
return Object.assign(props, { options });
}

@@ -256,0 +255,0 @@ getSubfields(name = '') {

@@ -225,15 +225,14 @@ import { __rest } from "tslib";

}
const options = props.options;
let options = props.options;
if (options) {
if (Array.isArray(options)) {
props.allowedValues = options.map(option => option.value);
props.transform = (value) => options.find(option => option.value === value).label;
if (!Array.isArray(options)) {
options = Object.entries(options).map(([key, value]) => ({
key,
label: key,
value,
}));
}
else {
props.allowedValues = Object.keys(options);
props.transform = (value) => options[value];
}
}
else if (props.enum) {
props.allowedValues = props.enum;
options = Object.values(props.enum).map(value => ({ value }));
}

@@ -251,3 +250,3 @@ propsToRename.forEach(([key, newKey]) => {

});
return props;
return Object.assign(props, { options });
}

@@ -254,0 +253,0 @@ getSubfields(name = '') {

{
"name": "uniforms-bridge-json-schema",
"version": "4.0.0-alpha.3",
"version": "4.0.0-alpha.4",
"license": "MIT",

@@ -39,5 +39,5 @@ "main": "./cjs/index.js",

"tslib": "^2.2.0",
"uniforms": "^4.0.0-alpha.3"
"uniforms": "^4.0.0-alpha.4"
},
"gitHead": "1353ab3a541d279a50e2dadfbc8e7684fd1a4fab"
"gitHead": "e046d871f3514c8f7e2d45cf957495444507b848"
}

@@ -89,2 +89,10 @@ import invariant from 'invariant';

/** Option type used in SelectField or RadioField */
type Option<Value> = {
disabled?: boolean;
label?: string;
key?: string;
value: Value;
};
type FieldError = {

@@ -310,17 +318,17 @@ instancePath?: string;

type OptionDict = Record<string, string>;
type OptionList = { label: string; value: unknown }[];
type Options = OptionDict | OptionList;
const options: Options = props.options;
type OptionList = Option<unknown>[];
type OptionDict = Record<string, unknown>;
type Options = OptionList | OptionDict;
let options: Options | undefined = props.options;
if (options) {
if (Array.isArray(options)) {
props.allowedValues = options.map(option => option.value);
props.transform = (value: unknown) =>
options.find(option => option.value === value)!.label;
} else {
props.allowedValues = Object.keys(options);
props.transform = (value: string) => options[value];
if (!Array.isArray(options)) {
options = Object.entries(options).map(([key, value]) => ({
key,
label: key,
value,
}));
}
} else if (props.enum) {
props.allowedValues = props.enum;
options = Object.values(props.enum).map(value => ({ value }));
}

@@ -341,3 +349,3 @@

return props;
return Object.assign(props, { options });
}

@@ -344,0 +352,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