Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

is-negative

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-negative

Check if something is a negative number

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
21K
-26.48%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

negative

FAQs

Package last updated on 11 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts