function letterValidator(validatorProps) {
return function validateLetter(value, context) {
// Be sure not to overwrite the original
// validatorProps variable (which would affect
// repeated validation calls)
let resolvedProps = validatorProps;
if (typeof resolvedProps === 'function') {
resolvedProps = resolvedProps(context);
resolvedProps = resolvedProps || {};
const {letter} = resolvedProps;
message: `Must match "${letter}"`,
isValid: (value === letter)