File tree Expand file tree Collapse file tree 1 file changed +15
-16
lines changed Expand file tree Collapse file tree 1 file changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -91,25 +91,24 @@ function makeNormalizer({
9191 collapseWhitespace,
9292 normalizer,
9393} : 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 ) {
11095 // No custom normalizer specified. Just use default.
11196 return getDefaultNormalizer ( { trim, collapseWhitespace} )
11297 }
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
113112}
114113
115114export { fuzzyMatches , matches , getDefaultNormalizer , makeNormalizer }
You can’t perform that action at this time.
0 commit comments