/** * Fetch the ID of a channel matched by type and channel data filter * * @param {string} type - channel type * @param {object} filter - to be matched against channel data * @returns {number} channelID */ getDataChannelId (type, filter) { return Object .keys(this._channelMap) .find(cid => { const c = this._channelMap[cid] const fv = _pick(c, Object.keys(filter)) return c.channel === type && _isEqual(fv, filter) }) }
const fv = _pick(msg, Object.keys(sub[1]))