Skip to content

Commit a00e748

Browse files
chore: refactor tryNormalizeType function (#59)
1 parent 5ecc141 commit a00e748

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,17 +246,12 @@ function normalizeType (value) {
246246
* Try to normalize a type and remove parameters.
247247
*
248248
* @param {string} value
249-
* @return {string}
249+
* @return {(string|null)}
250250
* @private
251251
*/
252-
253252
function tryNormalizeType (value) {
254-
if (!value) {
255-
return null
256-
}
257-
258253
try {
259-
return normalizeType(value)
254+
return value ? normalizeType(value) : null
260255
} catch (err) {
261256
return null
262257
}

0 commit comments

Comments
 (0)