when
when :: (Function, Function) → Function → Boolean
/* Part of the contains validator */
const contains = (value) => compose(
when(isString, (string) => string.includes(value)),
when(Array.isArray, arrayContains(value)),
when(not(or(isString, Array.isArray)), stubFalse),
);Related validators
composeornotLast updated