diff options
| author | Johann-S <[email protected]> | 2020-03-20 22:33:23 +0100 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2020-03-31 21:11:29 +0300 |
| commit | dabd458b4b817136e2a34c97d40e8854c344bf69 (patch) | |
| tree | 675d460ce2690f127325d21905bbe749d82e62f2 /js/src | |
| parent | 0c8d8a48e143206452a3cb3ee2d8cf1e49488dbb (diff) | |
| download | bootstrap-dabd458b4b817136e2a34c97d40e8854c344bf69.tar.xz bootstrap-dabd458b4b817136e2a34c97d40e8854c344bf69.zip | |
Backport (#30383)
fix: ensure totype always return stringified null when null passed
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() } |
