File tree 1 file changed +15
-16
lines changed 1 file changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -91,25 +91,24 @@ function makeNormalizer({
91
91
collapseWhitespace,
92
92
normalizer,
93
93
} : NormalizerOptions ) {
94
- if ( normalizer ) {
95
- // User has specified a custom normalizer
96
- if (
97
- typeof trim !== 'undefined' ||
98
- typeof collapseWhitespace !== 'undefined'
99
- ) {
100
- // They've also specified a value for trim or collapseWhitespace
101
- throw new Error (
102
- 'trim and collapseWhitespace are not supported with a normalizer. ' +
103
- 'If you want to use the default trim and collapseWhitespace logic in your normalizer, ' +
104
- 'use "getDefaultNormalizer({trim, collapseWhitespace})" and compose that into your normalizer' ,
105
- )
106
- }
107
-
108
- return normalizer
109
- } else {
94
+ if ( ! normalizer ) {
110
95
// No custom normalizer specified. Just use default.
111
96
return getDefaultNormalizer ( { trim, collapseWhitespace} )
112
97
}
98
+
99
+ if (
100
+ typeof trim !== 'undefined' ||
101
+ typeof collapseWhitespace !== 'undefined'
102
+ ) {
103
+ // They've also specified a value for trim or collapseWhitespace
104
+ throw new Error (
105
+ 'trim and collapseWhitespace are not supported with a normalizer. ' +
106
+ 'If you want to use the default trim and collapseWhitespace logic in your normalizer, ' +
107
+ 'use "getDefaultNormalizer({trim, collapseWhitespace})" and compose that into your normalizer' ,
108
+ )
109
+ }
110
+
111
+ return normalizer
113
112
}
114
113
115
114
export { fuzzyMatches , matches , getDefaultNormalizer , makeNormalizer }
You can’t perform that action at this time.
0 commit comments