You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
731 B

const Types = {
isPrototype( data ) {
return Object.prototype.toString.call(data).toLowerCase()
},
isArray( data ) {
return this.isPrototype( data ) === '[object array]'
},
isJSON( data ) {
return this.isPrototype( data ) === '[object object]'
},
isFunction( data ) {
return this.isPrototype( data ) === '[object function]'
},
isString( data ) {
return this.isPrototype( data ) === '[object string]'
},
isNumber( data ) {
return this.isPrototype( data ) === '[object number]'
},
isUndefined( data ) {
return this.isPrototype( data ) === '[object undefined]'
},
isNull( data ) {
return this.isPrototype( data ) === '[object null]'
}
}
module.exports = Types