# typeof-utility

> Extended functions for defining and converting data types.

Latest version **1.0.5** (published 2019-06-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install typeof-utility
pnpm add typeof-utility
yarn add typeof-utility
bun add typeof-utility
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2019-06-30 |
| First published | 2019-06-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=0.10.0 |
| Dependencies | 1 |
| Unpacked size | 29.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | GoshaV Maniako |
| Maintainers | rozaverta |
| Keywords | is-object, is-string, is-boolean, is-plain, is-scalar, is-web, is-cli, is-number, is-numeric, is-dom, is-simbol, is-window, is-element, is-empty, javascript, type, typeof, tostring |

## Links

- npm: https://www.npmjs.com/package/typeof-utility
- Repository: https://github.com/rozaverta/typeof-utility
- Issues: https://github.com/rozaverta/typeof-utility/issues
- npm.io page: https://npm.io/package/typeof-utility

## Dependencies (1)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.4.5

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2019-06-30
- 1.0.4 — 2019-06-28

## README

# typeof-utility 

> Extended functions for defining and converting data types.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save typeof-utility
```

## Usage

All functions

```js
import * as Utils from 'typeof-utility';
```

Or individual functions

```js
import {isString, isNumber, isNumeric} from 'typeof-utility';
```

```js
const text = "text", infinityValue = 1/0, textNumber = "1";

typeof text === "string"; // boolean -> TRUE
typeof infinityValue === "number"; // boolean -> TRUE
typeof textNumber === "number"; // boolean -> FALSE

isString(text); // boolean -> TRUE, equiv `typeof text === "string"`
isNumber(infinityValue); // boolean -> FALSE
isNumber(textNumber); // boolean -> FALSE
isNumeric(textNumber); // boolean -> TRUE
```

## Documents

| **Function** | **Description** |  
| --- | --- |
| instanceOf(left:&#160;any,&#160;right:&#160;any):&#160;boolean | Default `instanceof` wrapper. | 
| typeOf(value:&#160;any):&#160;boolean | Default `typeof` wrapper. | 
| isNumber(value:&#160;any):&#160;boolean | Value is number, not NaN and is finite. | 
| isNumeric(value:&#160;any):&#160;boolean | Value is number or a string convertible to a number, not NaN and is finite. | 
| isScalar(value:&#160;any):&#160;boolean | Value is null, undefined, string, boolean or number. | 
| isFunc(value:&#160;any):&#160;boolean | Value is function. | 
| isObject(value:&#160;any):&#160;boolean | Value is object, not null. | 
| isPlainObject(value:&#160;any):&#160;boolean | Returns true if an object was created by the Object constructor. | 
| isString(value:&#160;any):&#160;boolean | Value is string. | 
| isBool(value:&#160;any):&#160;boolean | Value is boolean. | 
| isNull(value:&#160;any):&#160;boolean | Value is null or undefined. | 
| isSymbol(value:&#160;any):&#160;boolean | Value is classified as a Symbol primitive or object. | 
| isDOMElement(value:&#160;any):&#160;boolean | Value is likely a DOM element. | 
| isWindowElement(value:&#160;any):&#160;boolean | Object is window. | 
| isEmpty(value:&#160;any):&#160;boolean | Value is an empty object, collection, map, or set. | 
| isWeb(value:&#160;any):&#160;boolean | The script works in the browser. | 
| isCli(value:&#160;any):&#160;boolean | The script is running as a CLI. | 
| type(value:&#160;any):&#160;string | Extended Value Type <br> Possible values: `Null`, `Undefined`, `Array`, `Date`, `RegExp`, `Event`, `Node`, `Window`, `NodeList`, `Object`, `Number`, `NaN`, `Infinity`, `Symbol`, `String`, `Boolean`, `Function` | 
| toString(value:&#160;any):&#160;string | Convert value to string. <br> Warning: if the value is a function, it will be called | 

### License

Copyright © 2019, [GoshaV Maniako](https://github.com/rozaverta).
Released under the [MIT License](LICENSE).

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