export const isString = (val) => {
return Object.prototype.toString.call(val).slice(8, -1) === 'String'
}
export const isNumber = (val) => {
return Object.prototype.toString.call(val).slice(8, -1) === 'Number'
}
export const isBoolean = (val) => {
return Object.prototype.toString.call(val).slice(8, -1) === 'Boolean'
}
export const isFunction = (val) => {
return Object.prototype.toString.call(val).slice(8, -1) === 'Function'
}
export const isNull = (val) => {
return Object.prototype.toString.call(val).slice(8, -1) === 'Null'
}
export const isUndefined = (val) => {
return Object.prototype.toString.call(val).slice(8, -1) === 'Undefined'
}
export const isObj = (val) => {
return Object.prototype.toString.call(val).slice(8, -1) === 'Object'
}
export const isArray = (val) => {
return Object.prototype.toString.call(val).slice(8, -1) === 'Array'
}
export const isDate = (val) => {
return Object.prototype.toString.call(val).slice(8, -1) === 'Date'
}
export const isRegExp = (val) => {
return Object.prototype.toString.call(val).slice(8, -1) === 'RegExp'
}
export const isError = (val) => {
return Object.prototype.toString.call(val).slice(8, -1) === 'Error'
}
export const isSymbol = (val) => {
return Object.prototype.toString.call(val).slice(8, -1) === 'Symbol'
}
export const isPromise = (val) => {
return Object.prototype.toString.call(val).slice(8, -1) === 'Promise'
}
export const isSet = (val) => {
return Object.prototype.toString.call(val).slice(8, -1) === 'Set'
}
export function isNullObjectFn(value) {
let arr = Object.keys(value)
if (arr.length === 0) {
return true
} else {
return false
}
}
function deleteFromArray(arr, compare) {
const index = arr.findIndex(compare)
if (index > -1) {
arr.splice(index, 1)
}
}