Skip to content

Commit

Permalink
fix(validator): not accept empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD committed Jan 23, 2023
1 parent 8b9431f commit 433236b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/validator/src/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function validator<T extends ValidType>(
}
}
else if (itemSchema === String) {
if (typeof itemValue !== 'string') {
if (typeof itemValue !== 'string' || itemValue === '') {
throw new Error('invalid_type', {
cause: {
message: 'invalid type',
Expand Down

0 comments on commit 433236b

Please sign in to comment.