How to use the lodash.isEmpty function in lodash

To help you get started, we’ve selected a few lodash examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github n8n-io / n8n / packages / nodes-base / nodes / Mandrill / Mandrill.node.ts View on Github external
return aux;
					});
				}

				const metadataUi = this.getNodeParameter('metadataUi') as IDataObject;
				if (!_.isEmpty(metadataUi)) {
					// @ts-ignore
					body.message.metadata = _.map(metadataUi.metadataValues, (o) => {
						const aux: IDataObject = {};
						aux[o.name] = o.value;
						return aux;
					});
				}

				const mergeVarsUi = this.getNodeParameter('mergeVarsUi') as IDataObject;
				if (!_.isEmpty(mergeVarsUi)) {
					// @ts-ignore
					body.message.global_merge_vars = _.map(mergeVarsUi.mergeVarsValues, (o) => {
						const aux: IDataObject = {};
						aux.name = o.name;
						aux.content = o.content;
						return aux;
					});
				}

				const attachmentsUi = this.getNodeParameter('attachmentsUi') as IDataObject;
				let attachmentsBinary = [], attachmentsValues = [];
				if (!_.isEmpty(attachmentsUi)) {

					if (attachmentsUi.hasOwnProperty('attachmentsValues')
						&& !_.isEmpty(attachmentsUi.attachmentsValues)) {
						// @ts-ignore
github dtjohnson / xlsx-populate / dist / Cell.js View on Github external
const vNode = xmlq.findChild(node, 'v');
            this._value = vNode && Number(vNode.children[0]);
        }
        // Delete known attributes.
        delete node.attributes.r;
        delete node.attributes.s;
        delete node.attributes.t;
        // If any unknown attributes are still present, store them for later output.
        if (!_.isEmpty(node.attributes))
            this._remainingAttributes = node.attributes;
        // Delete known children.
        xmlq.removeChild(node, 'f');
        xmlq.removeChild(node, 'v');
        xmlq.removeChild(node, 'is');
        // If any unknown children are still present, store them for later output.
        if (!_.isEmpty(node.children))
            this._remainingChildren = node.children;
    }
}
github joelcoxokc / slush-y / generators / server_api / index.js View on Github external
function init(cb){


        filters.fields = parseArgs( flags.fields );
        filters.module = flags.module

        if(_.isEmpty(filters.module)){
          _this.prompts.push( prompts.module )
        }
        if(_.isEmpty(filters.fields)){
          _this.prompts.push( prompts.fields )
        }

        if(_.size( _this.prompts )){
          if(_this.prompts[0].name === 'module'){
            _this.prompts[0].choices = findModules();
          }
          startPrompt( next );

        } else {

          next({});
github agalwood / Motrix / src / renderer / api / Api.js View on Github external
savePreferenceToNativeStore (params = {}) {
    const { user, system, others } = separateConfig(params)
    if (!isEmpty(system)) {
      console.info('[Motrix] save system config: ', system)
      application.configManager.setSystemConfig(system)
      this.changeGlobalOption(system)
    }

    if (!isEmpty(user)) {
      console.info('[Motrix] save user config: ', user)
      application.configManager.setUserConfig(user)
    }

    if (!isEmpty(others)) {
      console.info('[Motrix] save config found iillegal key: ', others)
    }
  }
github apgzs / cool-admin-api / app / service / comm / file.ts View on Github external
public async upload () {
        const ctx = this.ctx;
        if (_.isEmpty(ctx.request.files)) {
            throw new Error('上传文件为空');
        }
        const file = ctx.request.files[0];
        try {
            const extend = file.filename.split('.');
            const name = moment().format('YYYYMMDD') + '/' + uuid() + '.' + extend[extend.length - 1];
            const result = await ctx.oss.put(name, file.filepath);
            if (result.url && result.url.indexOf('http://') !== -1) {
                result.url = result.url.replace('http', 'https');
            }
            return result;
        } catch (err) {
            throw new Error('上传文件失败:' + err);
        }
    }
github gridgain / gridgain / modules / web-console / frontend / app / services / LegacyUtils.service.js View on Github external
domainForQueryConfigured(domain) {
            const isEmpty = !isDefined(domain) || (_.isEmpty(domain.fields) &&
                _.isEmpty(domain.aliases) &&
                _.isEmpty(domain.indexes));

            return !isEmpty;
        },
        domainForStoreConfigured,
github holistics / dbml / packages / dbml-core / jestHelpers.js View on Github external
const isTokenEmptyProperty = (key, value) => {
    return key === 'token' || value === undefined || value === null
      || (Array.isArray(value) && _.isEmpty(value)) || (typeof value === 'object' && _.isEmpty(value));
  };
github watzon / json-to-crystal / src / index.js View on Github external
.map((x, i) => {
          let key = this.options.transformKeys.call(this, x)
          let type = CrystalUtil.crystalType(this.properties[x])

          if (type === 'class') {
            if (_.isEmpty(this.properties[x])) {
              type = 'Hash(JSON::Any, JSON::Any)'
            } else {
              const klass = new CrystalClass(this.properties[x], key, _.defaultsDeep({ baseIndent: indentLevel - 1 }, this.options))
              this.subclasses.push(klass)
              type = klass.name
            }
          } else if (type === 'array') {
            const ary = new CrystalArray(this.properties[x], _.defaultsDeep({ baseIndent: indentLevel - 1 }, this.options))
            type = ary.toString()
            this.subclasses = this.subclasses.concat(ary.classes)
          }

          let str = `${key}: `

          if (this.options.explicit || key !== x) {
            str += `{ `
github researchspace / researchspace / researchspace / web / src / main / components / arguments / ArgumentsStore.ts View on Github external
graphs => {
      if (_.isEmpty(graphs)) {
        return Kefir.constant([]);
      } else {
        return Kefir.combine(_.map(graphs, deserializeArgument));
      }
    }
  ).toProperty();
github microsoft / pai / src / webportal / src / app / job-submission / models / docker-info.js View on Github external
static fromProtocol(dockerInfoProtocol, secrets) {
    let secretRef = get(dockerInfoProtocol, 'auth.password', '');
    let auth;
    if (!isNil(secretRef)) {
      let secretKey = SECRET_PATTERN.exec(secretRef);
      secretKey = isEmpty(secretKey) ? '' : secretKey[1];
      if (!isEmpty(secretKey) && !isNil(secrets[secretKey])) {
        auth = { ...dockerInfoProtocol.auth, password: secrets[secretKey] };
      } else {
        auth = {};
        secretRef = '';
      }
    }
    const isUseCustomizedDocker = DockerInfo.isUseCustomizedDocker(
      dockerInfoProtocol.uri,
    );
    return new DockerInfo({
      ...dockerInfoProtocol,
      auth: auth,
      secretRef: secretRef,
      isUseCustomizedDocker: isUseCustomizedDocker,
    });