diff options
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/util/index.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/js/src/util/index.js b/js/src/util/index.js index 8a5ae2156..fca2a9197 100644 --- a/js/src/util/index.js +++ b/js/src/util/index.js @@ -10,7 +10,13 @@ const MILLISECONDS_MULTIPLIER = 1000 const TRANSITION_END = 'transitionend' // Shoutout AngusCroll (https://goo.gl/pxwQGp) -const toType = obj => ({}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase()) +const toType = obj => { + if (obj === null || obj === undefined) { + return `${obj}` + } + + return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase() +} /** * -------------------------------------------------------------------------- |
