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

How to use
isEmpty
function
in
lodash

Best JavaScript code snippets using lodash.isEmpty(Showing top 15 results out of 423)

origin: sudo-suhas/elastic-builder

// eslint-disable-next-line require-jsdoc
  constructor(name, aggType) {
    if (isEmpty(aggType))
      throw new Error('Aggregation `aggType` cannot be empty');

    this._name = name;
    this.aggType = aggType;

    this._aggs = {};
    this._aggsDef = this._aggs[aggType] = {};
    this._nestedAggs = [];
  }
origin: benjsicam/nodejs-graphql-microservices

async count({ req, response }) {
  const count = await this._model.count({
   where: !isEmpty(req.where) ? JSON.parse(req.where) : undefined
  })

  response.res = { count }

  return response.res
 }
origin: 36node/sketch

function filterColumn(columns, checkedKeys = []) {
 if (!columns) return;
 return columns
  .map(c => {
   const children = filterColumn(c.children, checkedKeys);
   if (children) {
    return { ...c, children };
   }
   return c;
  })
  .filter(c => checkedKeys.includes(c.key) || !isEmpty(c.children));
}
origin: Aaaaash/typescript-react-redux-starter-kit

export function injectReducerFactory(store: LifeStore) {
 return function injectReducer(key: string, reducer: Reducer<object>) {
  invariant(
   isString(key) && !isEmpty(key) && isFunction(reducer),
   '(app/utils...) injectReducer: Expected `reducer` to be a reducer function'
  );
  if (Reflect.has(store.injectedReducers, key) && store.injectedReducers[key] === reducer) return;

  store.injectedReducers[key] = reducer;
  store.replaceReducer(createReducer(store.injectedReducers));
 };
}
origin: mariobermudezjr/ecommerce-react-graphql-stripe

componentDidUpdate(prevProps) {
  // Show required error if the input's value is received after the compo is mounted
  if (!isEmpty(this.props.value) && !this.state.hasInitialValue) {
   this.setInit();
  }

  // Check if errors have been updated during validations
  if (prevProps.didCheckErrors !== this.props.didCheckErrors) {
   // Remove from the state the errors that have already been set
   const errors = isEmpty(this.props.errors) ? [] : this.props.errors;
   this.setErrors(errors);
  }
 }
origin: benjsicam/nodejs-graphql-microservices

async getOrder(orderBy) {
  const queryOrder = {}

  if (!isEmpty(orderBy)) {
   if (orderBy.trim().charAt(0) === '-') {
    Object.assign(queryOrder, { orderBy: [orderBy.trim().substr(1), 'DESC'] })
   } else {
    Object.assign(queryOrder, { orderBy: [orderBy.trim(), 'ASC'] })
   }
  }

  return queryOrder
 }
origin: mindjs/mindjs

/**
  *
  * @param {InjectionToken} token
  * @param {Provider|Provider[]} notFoundProviders
  * @returns {{readonly provide?: *}[]}
  */
 getOverrideProviders(token, notFoundProviders = []) {
  const overrideProviders = this.platformProvidersOverride.filter(({ provide }) => provide === token);
  return isEmpty(overrideProviders) ? toArray(notFoundProviders) : overrideProviders;
 }
origin: sudo-suhas/elastic-builder

/**
   * Override default `toJSON` to return DSL representation for the `aggregation` query.
   *
   * @override
   * @returns {Object} returns an Object which maps to the elasticsearch query DSL
   */
  toJSON() {
    if (isEmpty(this._aggsDef.ranges)) {
      throw new Error('`ranges` cannot be empty.');
    }

    return super.toJSON();
  }
origin: manaflair/mylittledom

get firstChild() {

    if (isEmpty(this.childNodes))
      return null;

    return first(this.childNodes);

  }
origin: jakubkarabula/node-react-server-rendering

componentDidMount() {
    if (__isBrowser__) {
      if (isEmpty(this.props.jobs)) {
        this.props.fetchAction();
      }
    }
  }
origin: mariobermudezjr/ecommerce-react-graphql-stripe

componentDidUpdate(prevProps) {
  if (isEmpty(prevProps.value) && !isEmpty(this.props.value) && !this.state.hasInitValue) {
   this.setInitValue();
  }
 }
origin: sudo-suhas/elastic-builder

// eslint-disable-next-line require-jsdoc
  constructor(valueSrcType, refUrl, name, field) {
    if (isEmpty(valueSrcType))
      throw new Error('ValuesSourceBase `valueSrcType` cannot be empty');

    this._name = name;
    this._valueSrcType = valueSrcType;
    this._refUrl = refUrl;

    this._body = {};
    this._opts = this._body[valueSrcType] = {};

    if (!isNil(field)) this._opts.field = field;
  }
origin: sudo-suhas/elastic-builder

// eslint-disable-next-line require-jsdoc
  constructor(suggesterType, name, field) {
    if (isEmpty(suggesterType))
      throw new Error('Suggester `suggesterType` cannot be empty');
    if (isEmpty(name)) throw new Error('Suggester `name` cannot be empty');

    this.name = name;
    this.suggesterType = suggesterType;

    this._body = {};
    this._opts = this._body[name] = {};
    this._suggestOpts = this._opts[suggesterType] = {};

    if (!isNil(field)) this._suggestOpts.field = field;
  }
origin: benjsicam/nodejs-graphql-microservices

async destroy({ req, response }) {
  const count = await this._model.destroy({
   where: !isEmpty(req.where) ? JSON.parse(req.where) : {}
  })

  response.res = { count }

  return response.res
 }
origin: manaflair/mylittledom

get lastChild() {

    if (isEmpty(this.childNodes))
      return null;

    return last(this.childNodes);

  }
lodash(npm)isEmpty

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.
  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • webpack
    Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  • yargs
    yargs the modern, pirate-themed, successor to optimist.
  • request
    Simplified HTTP request client.
  • minimatch
    a glob matcher in javascript
  • through2
    A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise
  • postcss
  • glob
    a little globber
  • Github Copilot 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