Skip to content

shape() validation crash on undefined #740

Open
@xuntaka

Description

@xuntaka

Describe the bug

Nope.object().shape({a: Nope.string()}).validate(undefined);
TypeError: Cannot read property 'validate' of undefined

Nope.object().shape({a: Nope.string()}).validate();
TypeError: Cannot read property 'validate' of undefined

Expected behavior
It should return undefined like other items validation eg

Nope.array().of(Nope.string()).validate();
undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions