vine icon indicating copy to clipboard operation
vine copied to clipboard

requiredIf rules not available on array

Open padinko opened this issue 1 year ago • 0 comments

Package version

2.1.0

Describe the bug

there is no requiredIf* rules available when using array validator:

vine.compile(
    vine.object({
        ids: vine.array(
            vine.string(),
        )
            .optional()
            .requiredIfMissing('all'),

        all: vine.literal(true)
            .optional()
            .requiredIfMissing('ids'),
    }),
);

will throw:

vine.array(...).optional(...).requiredIfMissing is not a function

Reproduction repo

No response

padinko avatar Aug 26 '24 11:08 padinko