All files / Is index.js

50% Statements 14/28
0% Branches 0/13
16.67% Functions 2/12
50% Lines 14/28
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45    1x     1x     1x           1x 1x   1x     1x 1x   1x     1x     1x     1x           1x     1x      
export * from './regTest'
export * from './env'
export const isPlainObj = function(obj) {
  return Object.prototype.toString.call(obj) === '[object Object]'
}
export const isFunc = function(obj) {
  return typeof obj === 'function'
}
export const isNum = function(value, isStrict) {
  if (!isStrict) {
    value = +value
  }
  return typeof value === 'number' && !Number.isNaN(value)
}
export const isStr = function(obj) {
  return typeof obj === 'string'
}
export const isBool = function(obj) {
  return typeof obj === 'boolean'
}
export const isArr = function(obj) {
  return Array.isArray(obj)
}
export const isUNN = function(obj) {
  return obj === null || obj === undefined || Number.isNaN(obj)
}
export const isSymbol = function(obj) {
  return typeof obj === 'symbol'
}
export const isHljKey = function(key) {
  return isSymbol(key) && key.toString() === `Symbol(__hljKey__)`
}
export const isEmptyObj = function(obj) {
  for (let key in obj) {
    return false
  }
  return true
}
export const isEmptyArr = function(obj) {
  return isArr(obj) && obj.length === 0
}
export const isPromise = function(obj) {
  return isFunc(obj) && obj.then
}