Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
R.forEach(column => {
column.on_change = {
action: ChangeAction.Coerce,
failure: ChangeFailure.Reject
};
}, state.tableProps.columns || []);
function doAction(value: any, c: Options) {
const action = (c && c.on_change && c.on_change.action) || ChangeAction.Coerce;
switch (action) {
case ChangeAction.Coerce:
return { action, ...getCoercer(c)(value, c) };
case ChangeAction.None:
return { success: true, value, action };
case ChangeAction.Validate:
return { action, ...getValidator(c)(value, c) };
}
}
function doAction(value: any, c: Options) {
const action = (c && c.on_change && c.on_change.action) || ChangeAction.Coerce;
switch (action) {
case ChangeAction.Coerce:
return { action, ...getCoercer(c)(value, c) };
case ChangeAction.None:
return { success: true, value, action };
case ChangeAction.Validate:
return { action, ...getValidator(c)(value, c) };
}
}