aureooms-js-type
Version:
type checking code bricks for JavaScript
128 lines (104 loc) • 3.72 kB
Markdown
[js-type](http://aureooms.github.io/js-type)
==
Type checking code bricks for JavaScript.
```js
type.isfunction( function ( ) { } ) ; // true
```
[](https://raw.githubusercontent.com/aureooms/js-type/master/LICENSE)
[](https://www.npmjs.org/package/aureooms-js-type)
[](http://bower.io/search/?q=aureooms-js-type)
[](https://travis-ci.org/aureooms/js-type)
[](https://coveralls.io/r/aureooms/js-type)
[](https://david-dm.org/aureooms/js-type#info=dependencies)
[](https://david-dm.org/aureooms/js-type#info=devDependencies)
[](https://codeclimate.com/github/aureooms/js-type)
[](https://www.npmjs.org/package/aureooms-js-type)
[](https://github.com/aureooms/js-type/issues)
[](http://inch-ci.org/github/aureooms/js-type)
Can be managed through [jspm](https://github.com/jspm/jspm-cli),
[duo](https://github.com/duojs/duo),
[component](https://github.com/componentjs/component),
[bower](https://github.com/bower/bower),
[ender](https://github.com/ender-js/Ender),
[jam](https://github.com/caolan/jam),
[spm](https://github.com/spmjs/spm),
and [npm](https://github.com/npm/npm).
## Install
### jspm
```terminal
jspm install github:aureooms/js-type
# or
jspm install npm:aureooms-js-type
```
### duo
No install step needed for duo!
### component
```terminal
component install aureooms/js-type
```
### bower
```terminal
bower install aureooms-js-type
```
### ender
```terminal
ender add aureooms-js-type
```
### jam
```terminal
jam install aureooms-js-type
```
### spm
```terminal
spm install aureooms-js-type --save
```
### npm
```terminal
npm install aureooms-js-type --save
```
## Require
### jspm
```js
let type = require( "github:aureooms/js-type" ) ;
// or
import type from 'aureooms-js-type' ;
```
### duo
```js
let type = require( "aureooms/js-type" ) ;
```
### component, ender, spm, npm
```js
let type = require( "aureooms-js-type" ) ;
```
### bower
The script tag exposes the global variable `type`.
```html
<script src="bower_components/aureooms-js-type/js/dist/type.min.js"></script>
```
Alternatively, you can use any tool mentioned [here](http://bower.io/docs/tools/).
### jam
```js
require( [ "aureooms-js-type" ] , function ( type ) { ... } ) ;
```
## Use
### Generic methods
#### `type.isinstance( object )`
#### `type.isnull( object )`
#### `type.isundefined( object )`
### Methods for numbers
#### `type.isfinite( object )`
#### `type.isint32( object )`
#### `type.isint( object )`
#### `type.isnan( object )`
#### `type.isnegativeinfinity( object )`
#### `type.isnumber( object )`
#### `type.ispositiveinfinity( object )`
### Methods for objects
#### `type.isarray( object )`
#### `type.isboolean( object )`
#### `type.isdate( object )`
#### `type.isfunction( object )`
#### `type.isobject( object )`
#### `type.isregexp( object )`
#### `type.isstring( object )`