undefined typeof
This commit is contained in:
parent
d62716e301
commit
0eb63de209
13 changed files with 25 additions and 25 deletions
|
|
@ -59,7 +59,7 @@ const Chat = {
|
|||
},
|
||||
mounted() {
|
||||
window.addEventListener('scroll', this.handleScroll)
|
||||
if (typeof document.hidden !== 'undefined') {
|
||||
if (document.hidden !== undefined) {
|
||||
document.addEventListener(
|
||||
'visibilitychange',
|
||||
this.handleVisibilityChange,
|
||||
|
|
@ -74,7 +74,7 @@ const Chat = {
|
|||
unmounted() {
|
||||
window.removeEventListener('scroll', this.handleScroll)
|
||||
window.removeEventListener('resize', this.handleResize)
|
||||
if (typeof document.hidden !== 'undefined')
|
||||
if (document.hidden !== undefined)
|
||||
document.removeEventListener(
|
||||
'visibilitychange',
|
||||
this.handleVisibilityChange,
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ export default {
|
|||
emits: ['update:modelValue'],
|
||||
computed: {
|
||||
present() {
|
||||
return typeof this.modelValue !== 'undefined'
|
||||
return this.modelValue !== undefined
|
||||
},
|
||||
validColor() {
|
||||
return hex2rgb(this.modelValue || this.fallback)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export default {
|
|||
emits: ['update:modelValue'],
|
||||
computed: {
|
||||
present() {
|
||||
return typeof this.modelValue !== 'undefined'
|
||||
return this.modelValue !== undefined
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ export default {
|
|||
emits: ['update:modelValue'],
|
||||
computed: {
|
||||
present() {
|
||||
return typeof this.modelValue !== 'undefined'
|
||||
return this.modelValue !== undefined
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export default {
|
|||
emits: ['update:modelValue'],
|
||||
computed: {
|
||||
present() {
|
||||
return typeof this.modelValue !== 'undefined'
|
||||
return this.modelValue !== undefined
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ export default {
|
|||
return this.source || this.defaultSource
|
||||
},
|
||||
realDraftMode() {
|
||||
return typeof this.draftMode === 'undefined'
|
||||
return this.draftMode === undefined
|
||||
? this.defaultDraftMode
|
||||
: this.draftMode
|
||||
},
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ export default {
|
|||
})
|
||||
},
|
||||
mounted() {
|
||||
if (typeof this.shadowSelected === 'undefined') {
|
||||
if (this.shadowSelected === undefined) {
|
||||
this.shadowSelected = this.shadowsAvailable[0]
|
||||
}
|
||||
},
|
||||
|
|
@ -634,15 +634,15 @@ export default {
|
|||
if (input.version) version = input.version
|
||||
// Old v1 naming: fg is text, btn is foreground
|
||||
if (
|
||||
typeof colors.text === 'undefined' &&
|
||||
typeof colors.fg !== 'undefined'
|
||||
colors.text === undefined &&
|
||||
colors.fg !== undefined
|
||||
) {
|
||||
version = 1
|
||||
}
|
||||
// New v2 naming: text is text, fg is foreground
|
||||
if (
|
||||
typeof colors.text !== 'undefined' &&
|
||||
typeof colors.fg !== 'undefined'
|
||||
colors.text !== undefined &&
|
||||
colors.fg !== undefined
|
||||
) {
|
||||
version = 2
|
||||
}
|
||||
|
|
@ -679,7 +679,7 @@ export default {
|
|||
if (opacity && !this.keepOpacity) {
|
||||
this.clearOpacity()
|
||||
Object.entries(opacity).forEach(([k, v]) => {
|
||||
if (typeof v === 'undefined' || v === null || Number.isNaN(v)) return
|
||||
if (v === undefined || v === null || Number.isNaN(v)) return
|
||||
this[k + 'OpacityLocal'] = v
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ const Timeline = {
|
|||
})
|
||||
},
|
||||
mounted() {
|
||||
if (typeof document.hidden !== 'undefined') {
|
||||
if (document.hidden !== undefined) {
|
||||
document.addEventListener(
|
||||
'visibilitychange',
|
||||
this.handleVisibilityChange,
|
||||
|
|
@ -168,7 +168,7 @@ const Timeline = {
|
|||
unmounted() {
|
||||
window.removeEventListener('scroll', this.handleScroll)
|
||||
window.removeEventListener('keydown', this.handleShortKey)
|
||||
if (typeof document.hidden !== 'undefined')
|
||||
if (document.hidden !== undefined)
|
||||
document.removeEventListener(
|
||||
'visibilitychange',
|
||||
this.handleVisibilityChange,
|
||||
|
|
|
|||
|
|
@ -34,15 +34,15 @@ const VideoAttachment = {
|
|||
// If hasAudio is false, we've already marked this video to not have audio,
|
||||
// a video can't gain audio out of nowhere so don't bother checking again.
|
||||
if (!this.hasAudio) return
|
||||
if (typeof target.webkitAudioDecodedByteCount !== 'undefined') {
|
||||
if (target.webkitAudioDecodedByteCount !== undefined) {
|
||||
// non-zero if video has audio track
|
||||
if (target.webkitAudioDecodedByteCount > 0) return
|
||||
}
|
||||
if (typeof target.mozHasAudio !== 'undefined') {
|
||||
if (target.mozHasAudio !== undefined) {
|
||||
// true if video has audio track
|
||||
if (target.mozHasAudio) return
|
||||
}
|
||||
if (typeof target.audioTracks !== 'undefined') {
|
||||
if (target.audioTracks !== undefined) {
|
||||
if (target.audioTracks.length > 0) return
|
||||
}
|
||||
this.hasAudio = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue