How to use the mout/lang/isObject function in mout

To help you get started, we’ve selected a few mout 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 cam-inc / riotx / src / index.js View on Github external
commit(name, data) {
    if (data && !isObject(data)) {
      error(`[mutation]', 'The mutation data is not object type. name=${name} data=${data}`);
    }
    const context = {
      getter: (name, data) => {
        return this.getter.apply(this, [name, data]);
      },
      state: this._state
    };

    const fn = this._mutations[name];
    if (!fn || typeof fn !== 'function') {
      error(`[mutation]', 'The mutation is not a function. name=${name} data=${data}`);
    }

    debug('[mutation(before)]', name, this._state, data);
    const triggers = fn.apply(null, [context, data]);
github cam-inc / viron / src / pages / viron-components / card / chart / index.js View on Github external
const validate = data => {
    if (!isObject(data)) {
      return 'レスポンスデータに誤りがあります。';
    }
    return null;
  };
github cam-inc / viron / src / components / viron-parameters / util.js View on Github external
const trim = val => {
    let loop;
    if (isObject(val)) {
      loop = forOwn;
    } else if (isArray(val)) {
      loop = forEach;
    } else {
      return;
    }
    loop(val, (v, k) => {
      if (isNull(v)) {
        val[k] = undefined;
      }
      if (isObject(v) || isArray(v)) {
        trim(v);
      }
    });
  };
  trim(ret);
github cam-inc / viron / src / store / mutations / endpoints.js View on Github external
forOwn(newEndpoints, (endpoint, key) => {
      if (!isObject(endpoint)) {
        delete newEndpoints[key];
      }
    });
    state.endpoints[version] = newEndpoints;
github cam-inc / viron / src / components / viron-parameters / schema / index.js View on Github external
this.getPropertyValue = key => {
    if (!isObject(this.opts.val)) {
      return undefined;
    }
    return this.opts.val[key];
  };
github cam-inc / viron / src / core / fetch.js View on Github external
keys.forEach(key => {
    const value = body[key];

    if (isObject(value) || Array.isArray(value)) {
      formData.append(key, JSON.stringify(value));
    } else if (value != null) {
      formData.append(key, value);
    }
  });
github cam-inc / viron / src / components / viron-parameters / properties / index.js View on Github external
this.getVal = key => {
    if (!isObject(this.opts.val)) {
      return undefined;
    }
    return this.opts.val[key];
  };
github cam-inc / viron / src / components / viron-parameters / util.js View on Github external
loop(val, (v, k) => {
      if (isNull(v)) {
        val[k] = undefined;
      }
      if (isObject(v) || isArray(v)) {
        trim(v);
      }
    });
  };