diff options
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/util.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/js/src/util.js b/js/src/util.js index d130682e3..95186bb66 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -19,6 +19,10 @@ const MILLISECONDS_MULTIPLIER = 1000 // Shoutout AngusCroll (https://goo.gl/pxwQGp) function toType(obj) { + if (obj === null || typeof obj === 'undefined') { + return `${obj}` + } + return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase() } |
