# arguments.type

> Browser Node.js arguments type

Latest version **1.0.5** (published 2017-12-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install arguments.type
pnpm add arguments.type
yarn add arguments.type
bun add arguments.type
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2017-12-30 |
| First published | 2017-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mr.Panda |
| Maintainers | xivistudios |
| Keywords | Browser, Node.js, arguments, type |

## Links

- npm: https://www.npmjs.com/package/arguments.type
- Repository: https://github.com/xivistudios/arguments.type
- Issues: https://github.com/xivistudios/arguments.type
- npm.io page: https://npm.io/package/arguments.type

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2017-12-30
- 1.0.4 — 2017-12-24
- 1.0.3 — 2017-12-18
- 1.0.2 — 2017-12-16
- 1.0.1 — 2017-12-16
- 1.0.0 — 2017-12-16

## README

# arguments.type
> 浏览器和Node.JS环境通用的参数类型验证


安装
---
```sh
$ npm install arguments.type
```

快速入门
---
> 参数验证
```js
const ArgumentsType = require("arguments.type")()

ArgumentsType.equal(1, 1) // true
ArgumentsType.equal(1, 2) // true
ArgumentsType.equal(1, Number) // true
ArgumentsType.equal(1, String) // false
ArgumentsType.equal("1", "1") // true
ArgumentsType.equal("1", "2") // true
ArgumentsType.equal("1", Number) // false
ArgumentsType.equal("1", String) // true
ArgumentsType.equal({a: 1}, {a: Number}) // true
ArgumentsType.equal([1, "1", {a: 1}], [Number, String, Object]) // true
ArgumentsType.equal({a: {b: 1}}, {a: {b: Number}}) // true
ArgumentsType.equal({a: 1}, {a: [Number, String]}) // true

```

> 绑定到函数
```js
const ArgumentsType = require("arguments.type")

// 绑定到变量
let hello = ArgumentsType(function(name, key){
    return "hello！"
}).parameter(String, Number).result(String)

hello("panda", 1345) // "hello！"
hello("panda", "1346") // throw Error
```

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