Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2020-03-21 00:33:23 +0300
committerXhmikosR <xhmikosr@gmail.com>2020-03-31 21:11:29 +0300
commitdabd458b4b817136e2a34c97d40e8854c344bf69 (patch)
tree675d460ce2690f127325d21905bbe749d82e62f2 /js/src/util.js
parent0c8d8a48e143206452a3cb3ee2d8cf1e49488dbb (diff)
Backport (#30383)
fix: ensure totype always return stringified null when null passed
Diffstat (limited to 'js/src/util.js')
-rw-r--r--js/src/util.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/js/src/util.js b/js/src/util.js
index d130682e35..95186bb662 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()
}