How to use the mout/lang/isNull 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 / viron-parameters / validator.js View on Github external
if (isArray(value)) {
        isValid = true;
      }
      break;
    case 'object':
      if (isObject(value)) {
        isValid = true;
      }
      break;
    case 'boolean':
      if (isBoolean(value)) {
        isValid = true;
      }
      break;
    case 'null':
      if (isNull(value)) {
        isValid = true;
      }
      break;
    case 'file':
      // primitive typeには含まれないが`file`もサポートする。
      if (!!value && isString(value.name)) {
        isValid = true;
      }
      break;
    default:
      break;
    }
  });
  if (!isValid) {
github cam-inc / viron / src / components / atoms / viron-colorpicker / index.js View on Github external
const normalizeHexValue = value => {
    value = value.replace(/ /g, ' '); // eslint-disable-line no-irregular-whitespace

    if (isNull(value)) {
      return value;
    }

    if (isUndefined(value)) {
      return null;
    }

    // 正しいフォーマットだがシャープをつけていない場合、頭にシャープをつける
    if (isHex(value)) {
      value = concatenatePoundKey(value);
    }

    // HEXでなければ変更前の文字列に戻す
    if (!isTypingHex(value)) {
      value = this.opts.color.value;
    }
github cam-inc / viron / src / components / viron-jsonviewer / index.js View on Github external
const renderHtml = data => {
    let ret = '';

    // nullの場合
    if (isNull(data)) {
      ret = `<div class="${BlockName}__null">null</div>`;
      return ret;
    }

    // undefinedの場合
    if (isUndefined(data)) {
      ret = `<div class="${BlockName}__undefined">undefined</div>`;
      return ret;
    }

    // 関数の場合
    if (isFunction(data)) {
      ret = `<div class="${BlockName}__function">f()</div>`;
      return ret;
    }
github cam-inc / viron / src / components / viron-autocomplete / index.js View on Github external
const fetchAutocompleteOptions = val => {
    if (isNull(val) || isUndefined(val)) {
      return;
    }

    Promise
      .resolve()
      .then(() => store.action('oas.getAutocomplete', path, ObjectAssign({}, query, {
        [field]: val
      })))
      .then(options => {
        this.options = options;
        this.update();
      })
      .catch(err => store.action('modals.add', 'viron-error', {
        error: err
      }));
  };
github cam-inc / viron / src / components / atoms / viron-numberinput / index.js View on Github external
const increment = () => {
    const currentValue = this.normalizeValue(this.opts.number);
    const n = isNumber(step) ? step : 1;
    let newValue;
    if (isNull(currentValue)) {
      newValue = n;
    } else {
      newValue = currentValue + n;
    }
    return this.normalizeValue(newValue);
  };
github cam-inc / viron / src / components / viron-select / index.js View on Github external
this.handleBlockerTap = e => {
    e.stopPropagation();
    if (this.isMobile || !isClipboardCopySupported) {
      return;
    }
    const target = find(this.opts.options || [], { isSelected: true });
    const val = target && target.value;
    if (isUndefined(val) || isNull(val)) {
      return;
    }
    Promise
      .resolve()
      .then(() => {
        return clipboard.copy(String(val));
      })
      .then(() => store.action('toasts.add', {
        message: 'クリップボードへコピーしました。'
      }))
      .catch(() => {
        isClipboardCopySupported = false;
        store.action('toasts.add', {
          type: 'error',
          message: 'ご使用中のブラウザではクリップボードへコピー出来ませんでした。'
        });
github cam-inc / viron / src / components / atoms / viron-colorpicker / index.js View on Github external
const concatenatePoundKey = value => {
    const isIncludeSharp = value.match('^#');
    if (isNull(isIncludeSharp)) {
      value = `#${value}`;
    }
    return value;
  };
github cam-inc / viron / src / components / atoms / viron-autocomplete / index.js View on Github external
const fetchAutocompleteOptions = val => {
    if (isNull(val) || isUndefined(val)) {
      return;
    }

    Promise
      .resolve()
      .then(() => store.action('oas.getAutocomplete', path, ObjectAssign({}, query, {
        [field]: val
      })))
      .then(options => {
        this.options = options;
        this.update();
      })
      .catch(err => store.action('modals.add', 'viron-message', {
        error: err
      }));
  };