type/checkType.jsjavascript
/**
 * 返回值的标准化内部类型名称。
 * @function checkType
 * @memberof module:type
 * @param {*} variable 要判断的值
 * @returns {string} 例如 number、string、array、object、null
 */

function checkType(variable) {
  let str = Object.prototype.toString.call(variable)
  return str.match(/\[object (.*?)\]/)[1].toLowerCase()
}

export default checkType