# number-detect

> Thin wrapper around the chaijs/type-detect library

Latest version **0.4.0** (published 2021-08-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install number-detect
pnpm add number-detect
yarn add number-detect
bun add number-detect
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2021-08-06 |
| First published | 2017-04-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | xarxziux |
| Maintainers | xarxziux |
| Keywords | javascript, typeof |

## Links

- npm: https://www.npmjs.com/package/number-detect
- Repository: https://gitlab.com/xarxziux/number-detect
- Homepage: https://gitlab.com/xarxziux/number-detect#readme
- Issues: https://gitlab.com/xarxziux/number-detect/issues
- npm.io page: https://npm.io/package/number-detect

## Dependencies (1)

- [type-detect](https://npm.io/package/type-detect.md) ^4.0.8

## Recent versions

- 0.4.0 (latest) — 2021-08-06
- 0.3.3 — 2018-10-27
- 0.3.2 — 2018-10-27
- 0.3.1 — 2018-10-27
- 0.2.5 — 2018-05-17
- 0.2.4 — 2018-05-16
- 0.2.3 — 2018-03-09
- 0.2.1 — 2018-02-27
- 0.2.0 — 2018-02-16
- 0.1.0 — 2017-08-03
- 0.0.4 — 2017-04-22
- 0.0.3 — 2017-04-22
- 0.0.1 — 2017-04-14

## README

<!-- @format -->

# NUMBER-DETECT

This library is a thin wrapper around the type-detect library, and began life as a [rejected pull request](https://github.com/chaijs/type-detect/pull/92) for that library.

The library exposes a single function - numberDetect - which follows this logic:

1.  If the typeof the parameter passed is not equal to 'object' or 'number' return the typeof.
2.  If the typeof is 'object' and that object is null, return 'null', otherwise pass it to the type-detect library.
3.  If the typeof is 'number', sub-divide that type into 'NaN', 'Infinity', and 'number'.

The type-detect library only deals with 'object' typeofs and simply returns everything else, but for my uses, typeof 'number' is not useful given that typeof NaN, Infinity, and -Infinity all return 'number'. This library aims to fix that by returning a more meaningful result.

## Installation

```Bash
npm install --save number-detect
```

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/210754900d1341c89763877a29dc7558)](https://www.codacy.com/app/xarxziux/number-detect?utm_source=gitlab.com&amp;utm_medium=referral&amp;utm_content=xarxziux/number-detect&amp;utm_campaign=Badge_Grade)

---
_Source: https://npm.io/package/number-detect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
