1.1.1 • Published 2 years ago

weitypeprod v1.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

使用

  • 检测数据类型,简单数据类型和对象数据类型
  • 还可以传递第二个参数,true则保证得到的结果是Object.prototype.toString如 object BB的值
  • 如果是自定义对象,则是拿到构造函数的name
import type from 'weitypeprod'
// console.log(type)

let s =type('sss')
console.log(s)//string

class Person {}
let personChild =new Person
console.log(weiType(personChild))//person
console.log(weiType(personChild,true))//Person


let arr =[]
console.log(type(arr))//array


let date =new Date()
console.log(type(date))//date

function fun (){}
console.log(type(fun))//function
1.1.1

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago