# @konata9/typecheck.js

> JavaScript typecheck

Latest version **2.0.6** (published 2019-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @konata9/typecheck.js
pnpm add @konata9/typecheck.js
yarn add @konata9/typecheck.js
bun add @konata9/typecheck.js
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.6 |
| Published | 2019-04-29 |
| First published | 2019-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Konata9 |
| Maintainers | konata9 |
| Keywords | TypeCheck, typecheck, JavaScript, type |

## Links

- npm: https://www.npmjs.com/package/@konata9/typecheck.js
- Repository: https://github.com/Konata9/typecheck
- Homepage: https://github.com/Konata9/typecheck#readme
- Issues: https://github.com/Konata9/typecheck/issues
- npm.io page: https://npm.io/package/@konata9/typecheck.js

## 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

- 2.0.6 (latest) — 2019-04-29
- 2.0.5 — 2019-04-29
- 2.0.4 — 2019-04-29
- 2.0.2 — 2019-04-29
- 2.0.1 — 2019-04-29
- 2.0.0 — 2019-04-29
- 1.1.0 — 2019-01-19
- 1.0.8 — 2019-01-17
- 1.0.7 — 2019-01-16
- 1.0.6 — 2019-01-12
- 1.0.5 — 2019-01-12
- 1.0.4 — 2019-01-12
- 1.0.3 — 2019-01-12
- 1.0.2 — 2019-01-12
- 1.0.1 — 2019-01-12
- … 1 more at https://npm.io/package/@konata9/typecheck.js/versions

## README

# typecheck

Really simple type check function tool with **Pure JavaScript**. Check varible type in JavaScript.
**Rewrited by TypeScript**

## Install

```shell
npm i @konata9/typecheck.js
```

## Usage

**require usage has benn changed!**

```javascript
import typecheck from '@konata9/typecheck.js';
// or
import { typeCheck } from '@konata9/typecheck.js';
// or
const { typecheck } = require('@konata9/typecheck.js');

const arr = [];
typecheck(arr); // array
```

### typecheck(target)

The `target` is the varible you want to check. The return **type string** in table below.

| type      | example                     | return    |
| --------- | --------------------------- | --------- |
| string    | `typecheck("a")`            | string    |
| number    | `typecheck(1)`              | number    |
| boolean   | `typecheck(true)`           | boolean   |
| null      | `typecheck(null)`           | null      |
| undefined | `typecheck(undefined)`      | undefined |
| Object    | `typecheck({})`             | object    |
| Array     | `typecheck([])`             | array     |
| Set       | `typecheck(new Set())`      | set       |
| Map       | `typecheck(new Map())`      | map       |
| Symobol   | `typecheck(Symbol())`       | symbol    |
| Function  | `typecheck((a, b)=> a + b)` | function  |

### Test

This module is tested by mocha. You can find the test case in test folder or run the test command below (You need full source on the github page).

```shell
npm run test
```

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