@jsonforms/core
Advanced tools
Comparing version 3.4.0-alpha.2 to 3.4.0-alpha.3
@@ -432,2 +432,3 @@ import { ControlElement, JsonSchema, LabelElement, UISchemaElement } from '../models'; | ||
cells: JsonFormsCellRendererRegistryEntry[]; | ||
uischema: LabelElement; | ||
}; | ||
@@ -434,0 +435,0 @@ /** |
import type { JsonSchema } from '../models'; | ||
export declare const getFirstPrimitiveProp: (schema: any) => string; | ||
export declare const getFirstPrimitiveProp: (schema: unknown) => string; | ||
/** | ||
@@ -4,0 +4,0 @@ * Tests whether the schema has an enum based on oneOf. |
{ | ||
"name": "@jsonforms/core", | ||
"version": "3.4.0-alpha.2", | ||
"version": "3.4.0-alpha.3", | ||
"description": "Core module of JSON Forms", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/eclipsesource/jsonforms", |
@@ -1252,2 +1252,3 @@ /* | ||
cells: props.cells || getCells(state), | ||
uischema, | ||
}; | ||
@@ -1254,0 +1255,0 @@ }; |
@@ -29,12 +29,23 @@ /* | ||
export const getFirstPrimitiveProp = (schema: any) => { | ||
if (schema.properties) { | ||
return find(Object.keys(schema.properties), (propName) => { | ||
const prop = schema.properties[propName]; | ||
return ( | ||
prop.type === 'string' || | ||
prop.type === 'number' || | ||
prop.type === 'integer' | ||
); | ||
}); | ||
export const getFirstPrimitiveProp = (schema: unknown) => { | ||
if ( | ||
schema && | ||
typeof schema === 'object' && | ||
'properties' in schema && | ||
schema.properties | ||
) { | ||
return find( | ||
Object.keys(schema.properties), | ||
(propName: keyof typeof schema.properties) => { | ||
const prop: unknown = schema.properties[propName]; | ||
return ( | ||
prop && | ||
typeof prop === 'object' && | ||
'type' in prop && | ||
(prop.type === 'string' || | ||
prop.type === 'number' || | ||
prop.type === 'integer') | ||
); | ||
} | ||
); | ||
} | ||
@@ -41,0 +52,0 @@ return undefined; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1090092
14180