We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0f6ad22 + 2f2f948 commit fb327f7Copy full SHA for fb327f7
packages/core/core-types/validators.ts
@@ -9,7 +9,9 @@ export function makeValidator<T>(...values: T[]): (value: any) => value is T {
9
export function makeParser<T>(isValid: (value: any) => boolean, allowNumbers = false): (value: any) => T {
10
return (value) => {
11
const lower = value && value.toLowerCase();
12
- if (isValid(lower)) {
+ if (isValid(value)) {
13
+ return value;
14
+ } else if (isValid(lower)) {
15
return lower;
16
} else {
17
if (allowNumbers) {
0 commit comments