Tabnine Logo For Javascript
_includes
Code IndexAdd Tabnine to your IDE (free)

How to use
_includes
function
in
lodash

Best JavaScript code snippets using lodash._includes(Showing top 7 results out of 315)

origin: bitfinexcom/bitfinex-api-node

it('_handleConfigEvent: emits error if config failed', (done) => {
   ws = createTestWSv2Instance()
   ws.on('error', (err) => {
    if (_includes(err.message, '42')) done()
   })
   ws._handleConfigEvent({ status: 'bad', flags: 42 })
  })
origin: bitfinexcom/bitfinex-api-node

/**
  * Check if the instance is subscribed to the specified channel ID
  *
  * @param {number} chanId - ID of channel to query
  * @returns {boolean} isSubscribed
  */
 hasChannel (chanId) {
  return _includes(Object.keys(this._channelMap), chanId)
 }
origin: bitfinexcom/bitfinex-api-node

/**
  * NOTE: Cannot filter against pending subscriptions, due to unknown chanId
  *
  * @param {number} chanId - channel ID
  * @returns {object} wsState - undefined if not found
  */
 getSocketWithChannel (chanId) {
  return this._sockets.find(s => {
   return (
    s.ws.hasChannel(chanId) &&
    !_includes(s.pendingUnsubscriptions, chanId)
   )
  })
 }
origin: bitfinexcom/bitfinex-api-node

/**
  * Get the total number of data channels this instance is currently
  * subscribed too.
  *
  * @returns {number} count
  * @see WSv2#subscribeTrades
  * @see WSv2#subscribeTicker
  * @see WSv2#subscribeCandles
  * @see WSv2#subscribeOrderBook
  */
 getDataChannelCount () {
  return Object
   .values(this._channelMap)
   .filter(c => _includes(DATA_CHANNEL_TYPES, c.channel))
   .length
 }
origin: bitfinexcom/bitfinex-api-node

if (_includes(err.message, 'seq #')) errorsSeen++
origin: bitfinexcom/bitfinex-api-node

/**
  * Returns the first socket that is subscribed/pending sub to the specified
  * channel.
  *
  * @param {string} type - i.e. 'book'
  * @param {object} filter - i.e. { symbol: 'tBTCUSD', prec: 'R0' }
  * @returns {object} wsState - undefined if not found
  */
 getSocketWithDataChannel (type, filter) {
  return this._sockets.find(s => {
   const subI = s.pendingSubscriptions.findIndex(s => (
    s[0] === type && _isEqual(s[1], filter)
   ))

   if (subI !== -1) {
    return true
   }

   // Confirm unsub is not pending
   const cid = s.ws.getDataChannelId(type, filter)

   if (!cid) {
    return false
   }

   return cid && !_includes(s.pendingUnsubscriptions, cid)
  })
 }
origin: bitfinexcom/bitfinex-api-node

if (!_includes(e.message, 'no ws client')) {
 throw new Error('received unexpected error')
} else {
if (!_includes(e.message, 'currently closing')) {
 throw new Error('received unexpected error')
} else {
lodash(npm)_includes

Most used lodash functions

  • LoDashStatic.map
    Creates an array of values by running each element in collection through iteratee. The iteratee is
  • LoDashStatic.isEmpty
    Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string
  • LoDashStatic.forEach
    Iterates over elements of collection invoking iteratee for each element. The iteratee is invoked wit
  • LoDashStatic.find
    Iterates over elements of collection, returning the first element predicate returns truthy for.
  • LoDashStatic.pick
    Creates an object composed of the picked `object` properties.
  • LoDashStatic.get,
  • LoDashStatic.isArray,
  • LoDashStatic.filter,
  • LoDashStatic.merge,
  • LoDashStatic.isString,
  • LoDashStatic.isFunction,
  • LoDashStatic.assign,
  • LoDashStatic.extend,
  • LoDashStatic.includes,
  • LoDashStatic.keys,
  • LoDashStatic.cloneDeep,
  • LoDashStatic.uniq,
  • LoDashStatic.isObject,
  • LoDashStatic.omit

Popular in JavaScript

  • mime-types
    The ultimate javascript content-type utility.
  • chalk
    Terminal string styling done right
  • winston
    A logger for just about everything.
  • handlebars
    Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
  • ms
    Tiny millisecond conversion utility
  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • js-yaml
    YAML 1.2 parser and serializer
  • aws-sdk
    AWS SDK for JavaScript
  • fs
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now