Skip to content

Commit

Permalink
fix: allow passing of function to .matches() options/message param (#850
Browse files Browse the repository at this point in the history
)

* Allow passing of function to .matches()

* No strict type checking
  • Loading branch information
KeelanM90 authored Apr 23, 2020
1 parent 8cb2586 commit 16efe88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ inherits(StringSchema, MixedSchema, {
let name;

if (options) {
if (typeof options === 'string') message = options;
if (typeof options === 'object') {
({ excludeEmptyString, message, name } = options);
} else {
message = options;
}
}

Expand Down

0 comments on commit 16efe88

Please sign in to comment.