Skip to content

Commit

Permalink
fix: match options
Browse files Browse the repository at this point in the history
closes #802
closes #801
closes #799
closes #798
  • Loading branch information
jquense committed Mar 6, 2020
1 parent 94659c2 commit 493cc61
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 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 (options.message || 'excludeEmptyString' in options || options.name) {
if (typeof options === 'string') message = options;
if (typeof options === 'object') {
({ excludeEmptyString, message, name } = options);
} else message = options;
}
}

return this.test({
Expand Down

0 comments on commit 493cc61

Please sign in to comment.