Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
priority: priority => {
if (itemForm.value.category === 'Private') {
return setValue(0, disable(priority));
}
return priority.isEnabled ? priority : setValue(1, enable(priority));
},
})(cast(meta)),
password: (state, parentState) => {
if (!parentState.value.createAccount) {
return disable(state);
}
state = enable(state);
state = validate(state, validatePasswordsMatch);
return updateGroup(state, {
password: validate(required, minLength(8)),
});
},
agreeToTermsOfUse: validate(requiredTrue),
export function formStateReducer(state = INITIAL_STATE, a: BlockUIAction | UnblockUIAction) {
state = formGroupReducer(state, a);
switch (a.type) {
case BlockUIAction.TYPE: {
state = updateRecursive(
state,
s => setUserDefinedProperty(s, 'wasDisabled', s.isDisabled),
);
return disable(state);
}
case UnblockUIAction.TYPE: {
state = enable(state);
return updateRecursive(
state,
s => s.userDefinedProperties.wasDisabled ? disable(s) : s,
);
}
default: {
return state;
}
}
}
s => s.userDefinedProperties.wasDisabled ? disable(s) : s,
);
password: (state, parentState) => {
if (!parentState.value.createAccount) {
return disable(state);
}
state = enable(state);
return updateGroup(state, {
password: validate(required, minLength(8)),
confirmPassword: validate(equalTo(state.value.password)),
});
},
agreeToTermsOfUse: validate(requiredTrue),