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.
1 parent 08303ae commit 2f2f948Copy full SHA for 2f2f948
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