AlexGalays / idonttrustlikethat

Validation for TypeScript
40 stars 7 forks source link

Change `default` behavior #9

Closed grizio closed 3 years ago

grizio commented 3 years ago

Currently, only .nullable() and .optional() validator can default to a value. However, as a user of the lib, I suppose v.string.default(value) will default to a value too.

This commit changes the behavior of .default() by callings .nullable() first.