monkindey / argv

a light-weight function argument validator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

argv

A light-weight function argument validator and Inspired by aproba

Usage

type description
A Array
S String
N Number
F Function
O Object
B Boolean
E Error
function fn() {
  console.log("I am verified in fn");
}

var fnVerified = argv("SN")(fn);

fnVerified('123', 1) // true
fnVerified('123', '23') // false

About

a light-weight function argument validator


Languages

Language:JavaScript 100.0%