How to use the lodash-es.isEmpty function in lodash-es

To help you get started, we’ve selected a few lodash-es 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 Chimeejs / chimee / packages / chimee / src / dispatcher / index.ts View on Github external
private createKernel(video: HTMLVideoElement, config: {
    box: string;
    isLive: boolean;
    kernels: UserKernelsConfig;
    preset: {
        flv?: IVideoKernelConstructor;
        hls?: IVideoKernelConstructor;
        mp4?: IVideoKernelConstructor;
    };
    src: string;
}) {
    const { kernels, preset } = config;
    /* istanbul ignore else  */
    if (process.env.NODE_ENV !== 'production' && isEmpty(kernels) && !isEmpty(preset)) { chimeeLog.warn('preset will be deprecated in next major version, please use kernels instead.'); }
    const presetConfig: { [key: string]: SingleKernelConfig } = {};
    let newPreset: UserKernelsConstructorMap = {};
    if (isArray(kernels)) {
      // SKC means SingleKernelConfig
      newPreset = (kernels as (Array< SupportedKernelType | SingleKernelConfig >)).reduce((kernels: UserKernelsConstructorMap, keyOrSKC: SupportedKernelType | SingleKernelConfig) => {
        // if it is a string key, it means the kernel has been pre installed.
        if (isString(keyOrSKC)) {
          if (!isSupportedKernelType(keyOrSKC)) {
            throw new Error(`We have not support ${keyOrSKC} kernel type`);
          }
          const kernelFn = kernelsSet[keyOrSKC];
          if (!isFunction(kernelFn)) {
            chimeeLog.warn(`You have not installed kernel for ${keyOrSKC}.`);
            return kernels;
          }
          kernels[keyOrSKC] = kernelFn;
github openshift / console / frontend / public / components / row-filter.jsx View on Github external
setQueryParameters(selected) {
    // Ensure something is always active
    if (!_.isEmpty(selected)) {
      try {
        const recognized = _.filter(selected, (id) => _.find(this.props.items, { id }));
        setQueryArgument(this.storageKey, recognized.join(','));
      } catch (ignored) {
        // ignore
      }
      const allSelected = _.isEmpty(_.xor(selected, _.map(this.props.items, 'id')));
      this.setState({ allSelected, selected }, () => this.applyFilter());
    }
  }
github openshift / console / frontend / public / components / utils / horizontal-nav.tsx View on Github external
render() {
    const {
      metadata: { namespace },
      spec: { selector },
    } = this.props.obj;
    if (_.isEmpty(selector)) {
      return ;
    }

    // Hide the create button to avoid confusion when showing pods for an object.
    // Otherwise it might seem like you click "Create Pod" to add replicas instead
    // of scaling the owner.
    return (
      
    );
  }
}
github metaspace2020 / metaspace / metaspace / webapp / src / modules / MetadataEditor / MetadataEditor.vue View on Github external
getFormValueForSubmit() {
      this.validate()
      if (!isEmpty(this.localErrors)) {
        this.$message({
          message: 'Please check that you entered metadata correctly!',
          type: 'warning',
        })
        return null
      }

      return {
        datasetId: this.datasetId ? this.datasetId : '',
        metadataJson: JSON.stringify(this.value),
        metaspaceOptions: this.metaspaceOptions,
        initialMetadataJson: JSON.stringify(this.initialValue),
        initialMetaspaceOptions: this.initialMetaspaceOptions,
      }
    },
github openshift / console / frontend / public / components / modals / taints-modal.tsx View on Github external
render() {
    const effects = {
      NoSchedule: 'NoSchedule',
      PreferNoSchedule: 'PreferNoSchedule',
      NoExecute: 'NoExecute',
    };
    const { taints, errorMessage, inProgress } = this.state;
    return (
      <form name="form">
        Edit Taints
        
          {_.isEmpty(taints) ? (
            
          ) : (
            
              <div>
                <div>Key</div>
                <div>Value</div>
                <div>Effect</div>
                <div>
              </div>
              {_.map(taints, (c, i) =&gt; (
                <div>
                  <div>
                    <div>
                      Key
                    </div>
                    </div></div></div></form>
github openshift / console / frontend / public / module / k8s / probe.ts View on Github external
function inferAction(obj: Handler) {
  if (_.isEmpty(obj)) {
    return;
  }
  const keys = _.keys(obj);
  if (_.isEmpty(keys)) {
    return;
  }
  return HookAction[keys[0]];
}
github CityOfZion / neon-wallet / app / components / TokenSale / TokenSalePanel / TokenSaleSelection / TokenSaleSelection.jsx View on Github external
getAssetsToPurchaseWith,
  assetToPurchaseWith,
  assetToPurchase,
  amountToPurchaseFor,
  getPurchaseableAssets,
  updateField,
  inputErrorMessage,
}: Props) =&gt; {
  const maxBalance = assetBalances[assetToPurchaseWith]
  return (
    <section>
      <div>
        <h3>ICO Token</h3>
        
            updateField({ name: 'assetToPurchase', value: option.value })
          }
          options={getPurchaseableAssets().map(asset =&gt; ({
            label: asset,
            value: asset,
          }))}
          isSearchable={false}
        /&gt;
      </div>

      <div>
        <h3>Contribution</h3>
        </div></section>
github openshift / console / frontend / public / components / cluster-settings / ldap.jsx View on Github external
.then(d => {
          const configDotYaml = safeLoad(d.data['config.yaml']) || {};
          const connectorIndex = _.findIndex(configDotYaml.connectors, connector => connector.type === 'ldap' && connector.id === 'tectonic-ldap');
          this.setState({configDotYaml, connectorIndex, loadError: null, tectonicIdentityConfig: d});
          if (connectorIndex === -1) {
            return;
          }
          const formData = connectorToRedux(configDotYaml.connectors[connectorIndex]);
          if (_.isEmpty(formData)) {
            return;
          }
          this.props.initialize(formData);
        })
        .catch(loadError => this.setState({loadError}));
github openshift / console / frontend / public / module / k8s / resource.js View on Github external
export const resourceURL = (model, options) => {
  let q = '';
  let u = getK8sAPIPath(model);

  if (options.ns) {
    u += `/namespaces/${options.ns}`;
  }
  u += `/${model.plural}`;
  if (options.name) {
    u += `/${options.name}`;
  }
  if (options.path) {
    u += `/${options.path}`;
  }
  if (!_.isEmpty(options.queryParams)) {
    q = _.map(options.queryParams, function(v, k) {
      return `${k}=${v}`;
    });
    u += `?${q.join('&')}`;
  }

  return u;
};
github ipfs-shipyard / ipfs-webui / src / js / components / files / tree.js View on Github external
_onDirCreateBlur = (event) => {
    if (isEmpty(event.target.value)) {
      this.props.onCancelCreateDir()
    } else {
      this.props.onCreateDir()
    }
  }