Skip to content

Instantly share code, notes, and snippets.

View ShunYamauchi's full-sized avatar
😀

shun yamauchi ShunYamauchi

😀
View GitHub Profile
object().shape(
{
lunchStyles: array().min(1, 'お昼ごはんの選択は必須です。'),
salads: array().when(
['lunchStyles', 'soups'],
{
is: (
lunchStyles: string[],
soups: string[]
) =>
const validateLunchBoxStyle = function (this: any) {
const {
lunchStyles,
soups,
salads
} = this.parent
return !(
lunchStyles.includes('lunchBox') &&
soups.length === 0 &&
salads.length === 0