# @honeo/type-check

> 型・インスタンスのチェックなど

Latest version **2.5.1** (published 2017-01-01) · MIT license · 0 weekly downloads

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

## Install

```sh
npm install @honeo/type-check
pnpm add @honeo/type-check
yarn add @honeo/type-check
bun add @honeo/type-check
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.5.1 |
| Published | 2017-01-01 |
| First published | 2016-05-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | honeo |
| Maintainers | honeo |
| Keywords | type, check, typeof, instanceof |

## Links

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

## 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.5.1 (latest) — 2017-01-01
- 2.5.0 — 2016-12-31
- 2.4.0 — 2016-12-28
- 2.3.0 — 2016-11-08
- 2.1.0 — 2016-10-23
- 2.0.2 — 2016-10-09
- 2.0.1 — 2016-10-09
- 2.0.0 — 2016-10-08
- 1.5.0 — 2016-10-08
- 1.4.0 — 2016-05-15
- 1.3.0 — 2016-05-06
- 1.0.0 — 2016-05-05

## README

# type-check
* [honeo/type-check](https://github.com/honeo/type-check)
* [@honeo/type-check](https://www.npmjs.com/package/@honeo/type-check)

## Deprecated
Use [honeo/check](https://github.com/honeo/check) instead.

## なにこれ
型・インスタンス等をチェックするやつ。  
Polyfill前提。

## 使い方
```sh
$ npm i -S @honeo/type-check
```
```js
import {is, not} from '@honeo/type-check';
// or
import is from '@honeo/type-check/is';

is.arr([]); // true

not.num('hoge'); // false

is.obj({}, null); // false
```

## API
is, not共用。

### Type

#### array(), arr()
```js
is.array([]); // true

is.arr([], []); // true
```

#### boolean(), bool()
```js
is.boolean(false); // true

is.bool(true, false); // true
```

#### function(), func()
```js
is.function(function(){}); // true

is.func(_=>_, _=>_); // true
```

#### number(), num()
```js
is.number(1); // true

is.num(0, 1); // true
```

#### regexp(), re()
```js
is.regexp(/hoge/); // true

is.re(/foo/, /bar/); // true
```

#### string(), str()
```js
is.string('hoge'); // true

is.str('fuga', 'piyo'); // true
```

#### undefined()
```js
is.undefined(undefined); // true
```

#### null()
```js
is.null(null); // true
```

#### nan()
```js
is.nan(NaN); // true
```

#### date()
```js
is.date(new Date()); // true
```

#### object(), obj()
```js
is.object({}); // true

is.obj({}, {}); // true

is.obj(null); // false
```

#### promise()
```js
is.promise(new Promise(_=>_)); // true
```

### 数値

#### odd()
```js
is.odd(2); // true
```

#### even()
```js
is.even(3); // true
```

#### multiple(number, number)
```js
is.multiple(8080, 80); // true
```

### DOM

#### node()
```js
is.node(document.createElement('a'), document.createTextNode('hoge')); // true
```

#### textnode()
```js
is.textnode(document.createTextNode('hoge')); // true
```

#### element()
```js
is.element(document.head, document.body); // true
```

#### documentfragment(), df()
```js
is.df(document.createDocumentFragment()); // true
```


#### event()
```js
is.event( new Event("hoge") ); // true
```

#### eventtarget()
```js
is.eventtarget(document, window); // true
```

### その他

#### true()
```js
is.true(true, !0); // true
```

#### false()
```js
is.false(false !1); // true
```

#### truthy()
```js
is.truthy(true, "hoge", 1, [], {}); // true
```

#### falsy()
```js
is.falsy(null, undefined, "", 0, NaN); // true
```

#### objectliteral()
何も継承していない素のオブジェクトか。
```js
is.objectliteral({}); // true
not.objectliteral([], new function(){}); // true
```

#### arraylike()
```js
is.arraylike([], 'hoge'); // true
```

#### comparisonoperator()
有効な比較演算子の文字列か。
```js
is.comparisonoperator('<='); // true
```

#### semver()
有効なSemVer文字列か。
```js
is.semver('1.2.3'); // true

is.semver('1.0.0-foo.bar'); // true
```

#### versiom()
有効な数字とdotからなるバージョン文字列か。
```js
is.version('7.7.4', '2.5.0.1') // true
is.version('1.2A', 1.0); // false
```

#### empty()
引数の要素が空か。
```js
is.empty('', [], {}) // true
is.empty(0, null); // false
```

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