mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-30 15:24:08 +03:00
Backport (#30383)
fix: ensure totype always return stringified null when null passed
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user