1.0.2 • Published 8 years ago

is-positive-number v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

is-positive-number

Build Status

A javascript module that tests if an object is both a number and positive.

Install

$ npm install --save is-positive-number

Usage

var isPositiveNumber = require('is-positive-number');

isPositiveNumber(1) // = true

isPositiveNumber(0) // = true

isPositiveNumber(1.2) // = true

isPositiveNumber(-0) // = false

isPositiveNumber(-1) // = false

isPositiveNumber(-1.2) // = false

isPositiveNumber({ a: 1 }) // throws TypeError

isPositiveNumber(false) // throws TypeError

isPositiveNumber(true) // throws TypeError

Important note

  • This module throws a TypeError when the parameter isn't a number.
  • Also, this returns false for -0.
1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago