How to use the mout/lang/isNumber 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 / viron / src / components / atoms / viron-numberinput / index.js View on Github external
const isNumber = num => {
    if (isNaN(num)) {
      return false;
    }
    return _isNumber(num);
  };
  // opts文字列指定も許可する。
github cam-inc / viron / src / store / mutations / endpoints.js View on Github external
add: (state, endpointKey, endpoint) => {
    // order値が指定されていなければ自動的に設定する。
    if (!isNumber(endpoint.order)) {
      // リストの先頭に配置するために意図的にマイナス値を付与。
      endpoint.order = -1;
    }
    const version = state.application.version;
    let newEndpoints = ObjectAssign({}, state.endpoints[version]);
    newEndpoints[endpointKey] = endpoint;
    newEndpoints = putEndpointsInOrder(newEndpoints);
    state.endpoints[version] = newEndpoints;
    storage.set('endpoints', state.endpoints);
    return ['endpoints'];
  },
github cam-inc / viron / src / components / viron-parameters / form / index.js View on Github external
const isNumber = num => {// eslint-disable-line no-unused-vars
  if (isNaN(num)) {
    return false;
  }
  return _isNumber(num);
};
github cam-inc / viron / src / pages / viron-components / card / table / cell / index.js View on Github external
this.value = (() => {
    const data = this.opts.data;
    const column = this.opts.column;
    if (isNull(data)) {
      this.isText = true;
      return 'null';
    }
    if (isBoolean(data)) {
      this.isText = true;
      return (data ? 'true' : 'false');
    }
    if (isNumber(data)) {
      this.isText = true;
      return String(data);
    }
    if (isArray(data)) {
      this.isText = true;
      return '[...]';
    }
    if (isObject(data)) {
      this.isText = true;
      return '{...}';
    }
    if (isString(data)) {
      if (column.format === 'base64') {
        this.isBase64 = true;
        // MIME-type設定。指定無しであればpng画像とする。
        this.mimeType = column['x-mime-type'] || 'image/png';
github cam-inc / viron / src / components / viron-parameters / validator.js View on Github external
const maximumAndExclusiveMaximum = (value, constraints) => {
  const result = ObjectAssign({}, resultTemplate);
  if (!hasOwn(constraints, 'maximum')) {
    return result;
  }
  const maximum = constraints.maximum;
  if (!isNumber(maximum)) {
    return result;
  }
  // 未定義時はfalse扱い。
  const exclusiveMaximum = !!constraints.exclusiveMaximum;
  if (exclusiveMaximum) {
    if (value >= maximum) {
      result.isValid = false;
      result.message = `${maximum}より小さい数値にして下さい。`;
      return result;
    }
  } else {
    if (value > maximum) {
      result.isValid = false;
      result.message = `${maximum}以下の数値にして下さい。`;
      return result;
    }
github cam-inc / viron / src / components / atoms / viron-autocomplete / index.js View on Github external
this.normalizeValue = value => {
    if (isNumber(value)) {
      return String(value);
    }
    if (isUndefined(value)) {
      return null;
    }
    return value;
  };
github cam-inc / viron / src / components / viron-jsonviewer / index.js View on Github external
const isNumber = num => {
  if (isNaN(num)) {
    return false;
  }
  return _isNumber(num);
};
github cam-inc / viron / src / components / organisms / viron-parameters / form.js View on Github external
this.handleNumberinputChange = newNumber => {
    if (!isNumber(newNumber)) {
      newNumber = undefined;
    }
    this.opts.onchange(newNumber);
  };