Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (this.hoverEvent.action === 'show_item') {
let content
if (this.hoverEvent.value instanceof Array) {
if (this.hoverEvent.value[0] instanceof Object) {
content = this.hoverEvent.value[0].text
} else {
content = this.hoverEvent.value[0]
}
} else {
if (this.hoverEvent.value instanceof Object) {
content = this.hoverEvent.value.text
} else {
content = this.hoverEvent.value
}
}
this.hoverEvent.value = mojangson.parse(content)
}
}
}