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._manageCandles) {
const err = this._updateManagedCandles(key, data)
if (err) {
this.emit('error', err)
return
}
data = this._candles[key]
} else if (data.length > 0 && !Array.isArray(data[0])) {
data = [data] // always pass on an array of candles
}
if (this._transform) {
data = Candle.unserialize(data)
}
const internalMessage = [chanData.chanId, 'candle', data]
internalMessage.filterOverride = [chanData.key]
this._propagateMessageToListeners(internalMessage, chanData, false)
this.emit('candle', data, key)
}