'use strict';

exports.__esModule = true;
exports.inputTypeOverride = exports.inputType = exports.isoDateFormat = undefined;
exports.isEmpty = isEmpty;

var _lodash = require('lodash.isstring');

var _lodash2 = _interopRequireDefault(_lodash);

var _lodash3 = require('lodash.isundefined');

var _lodash4 = _interopRequireDefault(_lodash3);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/* global document */
var isoDateFormat = exports.isoDateFormat = 'YYYY-MM-DD';

function isEmpty(value) {
  return (0, _lodash4.default)(value) || (0, _lodash2.default)(value) && value.trim() === '' || value === false;
}

var inputType = exports.inputType = { date: false, number: false, time: false, month: false, week: false };

var inputTypeOverride = exports.inputTypeOverride = function inputTypeOverride(key, value) {
  inputType[key] = value;
};

/* istanbul ignore next  */
if (typeof document !== 'undefined' && typeof document.createElement === 'function') {
  var tester = document.createElement('input');

  for (var i in inputType) {
    if (inputType.hasOwnProperty(i)) {
      tester.type = i;
      tester.value = ':(';

      if (tester.type === i && tester.value === '') {
        inputType[i] = true;
      }
    }
  }
}