1.0.0 • Published 10 years ago

bloody-type v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
10 years ago

type

consistent type-testing micro-lib

browser support

Build Status

Install

$ npm install bloody-type

Require

var type = require("bloody-type")

API

type(arguments||array, checker1, checker2 …) > boolean

iterate over arguments or array and checks using each function passed if items have the right type.

e.g.

type([1,2], type.isNumber, type.isNumber) // true
type([1,"foo"], type.isNumber, type.isNumber) // false

All methods available take one argument, and return whether or not this argument matches the type.

type[method] (value) > boolean

  • type.isObject(value)
  • type.isString(value)
  • type.isArray(value)
  • type.isFunction(value)
  • type.isNumber(value)
  • type.isBoolean(value)
  • type.isBoolean(value)
  • type.isDate(value)
  • type.isRegExp(value)
  • type.isArguments(value)
  • type.isUndefined(value)
  • type.isNull(value)
  • type.isNaN(value)
  • type.isElement(value)
1.0.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago