Skip to content

Should we call custom checker function, when value is undefined and field is optional? #189

Open
@erfanium

Description

@erfanium

Consider this Code:

const check = v.compile({
   foo: {
      type: "string",
      optional: true,
      custom(v) {
         console.log("custom");
         return v;
      },
   },
});

check({});

Currently, the custom function is called.
Should custom function to be called? I don't think so

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions