Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

is-negative

kevva42.7kMIT2.1.0

Check if something is a negative number

negative, number, test, check

readme

is-negative Build Status

Check if something is a negative number

Install

$ npm install --save is-negative

Usage

const isNegative = require('is-negative');

isNegative(-1);
//=> true

isNegative(1);
//=> false

isNegative(0);
//=> false

isNegative('-1');
//=> false

isNegative(Number(-1))
//=> true

Note: This module doesn't consider -0 to be a negative number. If you want to detect -0, use the negative-zero module.

  • is-positive - Check if something is a positive number

License

MIT © Kevin Martensson