# @bemoje/type-of

> Returns a string representing a value's constructor's name property, except for 'NaN', infinite values, 'Infinity', 'Null' and 'Undefined'.

Latest version **1.0.4** (published 2020-04-30) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @bemoje/type-of
pnpm add @bemoje/type-of
yarn add @bemoje/type-of
bun add @bemoje/type-of
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2020-04-30 |
| First published | 2020-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Benjamin M. Jensen |
| Maintainers | bemoje |
| Keywords | returns, string, representing, value's, constructor's, property, nan', infinite, values, infinity', null, undefined', typeof, evaluate |

## Links

- npm: https://www.npmjs.com/package/@bemoje/type-of
- Repository: https://github.com/bemoje/bemoje-type-of
- Homepage: https://github.com/bemoje/bemoje-type-of#readme
- Issues: https://github.com/bemoje/bemoje-type-of/issues
- npm.io page: https://npm.io/package/@bemoje/type-of

## Dependencies (1)

- [@bemoje/is-number](https://npm.io/package/@bemoje/is-number.md) ^1.0.0

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.4 (latest) — 2020-04-30
- 1.0.3 — 2020-04-30
- 1.0.2 — 2020-04-30
- 1.0.1 — 2020-04-30
- 1.0.0 — 2020-04-25

## README

# @bemoje/type-of

Returns a string representing a value's constructor's name property, except for 'NaN', infinite values, 'Infinity', 'Null' and 'Undefined'.

#### Version

<span><a href="https://npmjs.org/@bemoje/type-of" title="View this project on NPM"><img src="https://img.shields.io/npm/v/@bemoje/type-of" alt="NPM version" /></a></span>

#### Travis CI

<span><a href="https://npmjs.org/@bemoje/type-of" title="View this project on NPM"><img src="https://travis-ci.org/bemoje/bemoje-type-of.svg?branch=master" alt="dependencies" /></a></span>

#### Dependencies

<span><a href="https://npmjs.org/@bemoje/type-of" title="View this project on NPM"><img src="https://david-dm.org/bemoje/bemoje-type-of.svg" alt="dependencies" /></a></span>

#### Stats

<span><a href="https://npmjs.org/@bemoje/type-of" title="View this project on NPM"><img src="https://img.shields.io/npm/dt/@bemoje/type-of" alt="NPM downloads" /></a></span>
<span><a href="https://github.com/bemoje/bemoje-type-of/fork" title="Fork this project"><img src="https://img.shields.io/github/forks/bemoje/bemoje-type-of" alt="Forks" /></a></span>

#### Donate

<span><a href="https://www.buymeacoffee.com/bemoje" title="Donate to this project using Buy Me A Beer"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?label=Buy me a beer!" alt="Buy Me A Beer donate button" /></a></span>
<span><a href="https://paypal.me/forstaaloen" title="Donate to this project using Paypal"><img src="https://img.shields.io/badge/paypal-donate-yellow.svg?label=PayPal" alt="PayPal donate button" /></a></span>

## Installation

```sh
npm install @bemoje/type-of
npm install --save @bemoje/type-of
npm install --save-dev @bemoje/type-of
```

## Usage

```javascript
import typeOf from '@bemoje/type-of'

typeOf(NaN)
//=> NaN

typeOf(Infinity)
//=> Infinity

typeOf(Number.POSITIVE_INFINITY)
//=> Infinity

typeOf(Number.NEGATIVE_INFINITY)
//=> Infinity

typeOf('asdf')
//=> 'String'

typeOf(new String('asdf'))
//=> 'String'

typeOf(1)
//=> 'Number'

typeOf(Number(1))
//=> 'Number'

typeOf(new Number(1))
//=> 'Number'

typeOf(new Object())
//=> 'Object'

typeOf({})
//=> 'Object'

typeOf([])
//=> 'Array'

class Custom {}

typeOf(new Custom())
//=> 'Custom'

typeOf(undefined)
//=> 'Undefined'

typeOf(null)
//=> 'Null'

```


## Tests
Uses *Jest* to test module functionality. Run tests to get coverage details.

```bash
npm run test
```

## API
### typeOf

##### Returns
a string representing a value's constructor's name property, except for 'NaN', infinite values, 'Infinity', 'Null' and 'Undefined'.

##### Parameters

-   `value` **any** The value to evaluate

##### Returns
**[string][3]** 

[1]: #typeof

[2]: #parameters

[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

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