Skip to content

Commit

Permalink
fix(to): dont convert null -> undefined when casting strings
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jan 23, 2019
1 parent b97d295 commit 92faef2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/to.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function to(v, type) {
throw new Error(`"${type}" is not a valid primitive type`);
}
if (v == null) {
return;
return v;
}

if (type === 'number' && Number.isNaN(v)) {
Expand Down

0 comments on commit 92faef2

Please sign in to comment.