New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@caiogondim/arg-type

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@caiogondim/arg-type

Like prop-types, but for vanilla JavaScript

2.0.0
latest
Source
npm
Version published
Weekly downloads
6
-72.73%
Maintainers
1
Weekly downloads
 
Created
Source

arg-type

Like prop-types, but for vanilla JavaScript

Installation

npm i -S @caiogondim/arg-type

Usage

Example:

import argType, { types } from '@caiogondim/arg-type'

function sum(a, b) {
  argType(a, types.number)
  argType(b, types.number)

  return a + b
}

sum(1, '2') // => throws TypeError because '2' is not a Number

Types

  • types.array
  • types.bool
  • types.func
  • types.number
  • types.object
  • types.string
  • types.null
  • types.symbol
  • types.instanceOf
  • types.oneOf
  • types.oneOfType
  • types.arrayOf
  • types.exact

caiogondim.com  ·  GitHub @caiogondim  ·  Twitter @caio_gondim

Keywords

types

FAQs

Package last updated on 10 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts