npm.io
1.0.4 • Published 10 years ago

aureooms-js-type

Licence
AGPL-3.0
Version
1.0.4
Deps
0
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

js-type

Type checking code bricks for JavaScript.

type.isfunction( function ( ) { } ) ; // true

NPM license NPM version Bower version Build Status Coverage Status Dependencies Status devDependencies Status Code Climate NPM downloads per month GitHub issues Inline docs

Can be managed through jspm, duo, component, bower, ender, jam, spm, and npm.

Install

jspm

jspm install github:aureooms/js-type
# or
jspm install npm:aureooms-js-type
duo

No install step needed for duo!

component
component install aureooms/js-type
bower
bower install aureooms-js-type
ender
ender add aureooms-js-type
jam
jam install aureooms-js-type
spm
spm install aureooms-js-type --save
npm
npm install aureooms-js-type --save

Require

jspm
let type = require( "github:aureooms/js-type" ) ;
// or
import type from 'aureooms-js-type' ;
duo
let type = require( "aureooms/js-type" ) ;
component, ender, spm, npm
let type = require( "aureooms-js-type" ) ;
bower

The script tag exposes the global variable type.

<script src="bower_components/aureooms-js-type/js/dist/type.min.js"></script>

Alternatively, you can use any tool mentioned here.

jam
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 )

Keywords