argue

0.0.1 • Public • Published

Basic Usage

Argue determines the argument signature received by a function.

 
var argue = require('argue');
 
function foo() {
  var sig = argue(arguments);
  switch(sig) {
    case 'sbnf':
      // we got a string, boolean, number, and function
      break;
 
    case 'nnnn':
      // we got four numbers
      break;
 
    case 'ord-':
      // we got an object, regexp, date, and null
      break;
 
    default:
      // you get the idea
  }
}
 

Argue returns the following characters for the following types:

Date : 'd'

Array : 'a'

RegExp : 'r'

Error : 'e'

String : 's'

Boolean: 'b'

Number : 'n'

Object : 'o'

Function: 'f'

null : '-'

undefined : 'u'

/argue/

    Package Sidebar

    Install

    npm i argue

    Weekly Downloads

    6

    Version

    0.0.1

    License

    none

    Last publish

    Collaborators

    • regality
    • grobot