Skip to content

Commit

Permalink
fix: Handle undefined in toString.
Browse files Browse the repository at this point in the history
  • Loading branch information
jheer committed Dec 9, 2020
1 parent 8ad2da8 commit 1047947
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/to-string.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import isBigInt from './is-bigint';

export default function(v) {
return isBigInt(v)
? (v.toString() + 'n')
return v === undefined ? v + ''
: isBigInt(v) ? v + 'n'
: JSON.stringify(v);
}

0 comments on commit 1047947

Please sign in to comment.