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

How to use
isArray
function
in
lodash

Best JavaScript code snippets using lodash.isArray(Showing top 15 results out of 315)

origin: manaflair/mylittledom

export function serializePropertyValue(value) {

  if (isArray(value))
    return value.map(sub => serializePropertyValue(sub));

  if (isObject(value) && Reflect.has(value, `serialize`))
    return value.serialize();

  return value;

}
origin: raulfdm/taco-api

describe('fn: getCategoriesList', () => {
 const categoriesList = CategoryController.getCategoriesList();

 it('should return an array', () => {
  expect(isArray(categoriesList)).toBeTruthy();
 });

 it('should return a full list', () => {
  expect(categoriesList.length).toBe(4);
 });
});
origin: 36node/sketch

const customizer = (objValue, srcValue, key, object, source, stack) => {
 if (stack.size === 2) {
  // will not merge array
  if (isArray(srcValue)) {
   return srcValue;
  }
 }
}
origin: bourbest/keeptrack

function deleteFeedSubscriptions (req, res, next) {
 if (!isArray(req.body) || req.body.length === 0) {
  return next({httpStatus: 400, message: 'no ids provided in the body'})
 }
 const repo = new ClientFeedSubcriptionRepository(req.database)
 const ids = req.body.map(ObjectId)
 return repo.deleteByClientIds(ids)
  .then(function () {
   next()
  })
  .catch(next)
}
origin: factlist/factlist-api

// Recursive merge with array concatenation
const mergeDeep = (a, b) =>
  mergeWith({}, a, b, (c, d) =>
    (isArray(c) && isArray(d))
      ? c.concat(d)
      : undefined
  )
origin: BrenoMazieiro/the-god-stack

function customizer(objValue, srcValue) {
 if (isArray(objValue)) {
  return objValue.concat(srcValue)
 }
 return undefined
}
origin: 36node/sketch

function createHumps(keyConverter) {
 return function humps(node) {
  if (isArray(node)) return map(node, humps);
  if (isPlainObject(node))
   return transform(node, createIteratee(keyConverter, humps));
  return node;
 };
}
origin: mindjs/mindjs

/**
 *
 * @param {Function[]|*} mwList
 * @returns {boolean}
 */
const isValidMiddlewareList = mwList => {
 return every([
  isArray(mwList),
  every(mwList, isFunction),
 ], Boolean);
}
origin: bourbest/keeptrack

const convertFromDatabase = (entity) => {
 if (isArray(entity)) {
  return entity.map(convertFromDatabase)
 } else if (entity) {
  const ret = omit(entity, '_id')
  ret.id = entity._id
  return ret
 }
 return null
}
origin: 36node/sketch

const notMergeArray = (objValue, srcValue, key, object, source, stack) => {
 if (isArray(srcValue)) {
  return srcValue;
 }
}
origin: 36node/sketch

const notMergeArray = (objValue, srcValue, key, object, source, stack) => {
 if (isArray(srcValue)) {
  return srcValue;
 }
}
origin: 36node/sketch

function createHumps(keyConverter) {
 return function humps(node) {
  if (isArray(node)) return map(node, humps);
  if (isPlainObject(node))
   return transform(node, createIteratee(keyConverter, humps));
  return node;
 };
}
origin: 36node/sketch

const customizer = (objValue, srcValue, key, object, source, stack) => {
 if (stack.size === 2) {
  // will not merge array
  if (isArray(srcValue)) {
   return srcValue;
  }
 }
}
origin: 36node/sketch

function createHumps(keyConverter) {
 return function humps(node) {
  if (isArray(node)) return map(node, humps);
  if (isPlainObject(node))
   return transform(node, createIteratee(keyConverter, humps));
  return node;
 };
}
origin: mindjs/mindjs

/**
 * Converts a value to array or returns it if it is an Array
 * @param value
 * @returns {*[]}
 */
function toArray(value) {
 return isArray(value) ? value : [value];
}
lodash(npm)isArray

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

  • mocha
    simple, flexible, fun test framework
  • glob
    a little globber
  • request
    Simplified HTTP request client.
  • postcss
  • mkdirp
    Recursively mkdir, like `mkdir -p`
  • yargs
    yargs the modern, pirate-themed, successor to optimist.
  • commander
    the complete solution for node.js command-line programs
  • moment
    Parse, validate, manipulate, and display dates
  • handlebars
    Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
  • Top Sublime Text plugins
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