Argumentify
From JSDoc info make sure that your arguments are valid appending validation code at the beginning of your functions using https://github.com/substack/node-falafel.
What does this means?
/** * @param */ { // your code wont be modified!}
Will be rewritten to:
/** * @param */ {if x == undefined || Number || 'number' !== typeof x throw "x is undefined or null" // your code wont be modified!}
So your comments generate code... at last!
Usage
Browserify transform
output_stream = fs; './index.js' //or: .transform(require('argumentify').verbose()) ;
Falafel
var output = src comment: true loc: true falafel;
API
// argumentify itself is a function for browserify compatibilityvar argumentify = ; //enable/disable verbose, usefull to fully cover your codeargumentify // add new validator or overwrite default onesargumentify; // This is the falafel callaback that transform your codeargumentifyfalafel; // return the array with default String check (typeof)argumentifycheck; // return the array with default Number check (typeof, !isNaN)argumentifycheck; // return the array with default Boolean check (typeof)argumentifycheck; // return the array with default Array check (Array.isArray)argumentifycheck; // return the array with default Object check (typeof, !Array.isArray)argumentifycheck; // return the array with default Function check (typeof)argumentifycheck; // return the array with default fixed size array of numbers check (...); // return the array with default fixed size 2 levels array of numbers check (...)
License
MIT