Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const getStyle = (styleName: string) =>
JsonForms.stylingRegistry.getAsClassName(styleName);
/**
* Default tester for an array control.
* @type {RankedTester}
*/
export const arrayTester: RankedTester = rankWith(2, and(
uiTypeIs('Control'),
schemaMatches(schema =>
!_.isEmpty(schema)
&& schema.type === 'array'
&& !_.isEmpty(schema.items)
&& !Array.isArray(schema.items) // we don't care about tuples
),
schemaSubPathMatches('items', schema =>
schema.type === 'object'
))
);
const addNewItem = (dispatch, path: string) => {
const element = {};
dispatch(
update(
path,
array => {
if (array === undefined || array === null) {
return [element];
}
const clone = _.clone(array);
clone.push(element);