1.2.2 • Published 6 years ago

ptype v1.2.2

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

import

// nodejs / module
const ptype = require('ptype')
or
// browser
<script type="javascript" src="ptype.js">
var num = 10

ptype(num)
/*
*   @return {
*       data: 10,
*       type: 'Number'    
*    }
*/

var arr = [0, 2]

ptype(arr)
/*
*   @return {
*       data: [0, 2],
*       type: 'Array'   
*    }
*/
var obj = {id: 2}

ptype(obj).isArray()       // false
ptype(obj).isObject()      // true

var date = new Date()

ptype(date).isDate()        // true
ptype( param )

@return {
    data: param,
    type: param-type
}

ptype( param )
.isObject()
.isArray()
.isNumber()
.isUndefined()
.isNull()
.isString()
.isFunction()
.isDate()
.isNaN()
.isBoolean()

@return false/true
1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago