lib/polymorphic.js
function parse(signature) {
		var pattern = /^(?:void|([a-zA-Z]+!?|\.{3})(?:[:\s]+([a-zA-Z]+)(?:(=)(@)?(.*))?)?)?$/;

		return signature.split(/\s*,\s*/).map(function(argument, index, all) {
			var result = prepareArgument(argument.match(pattern), 'var' + (index + 1));

			if (result.type === false) {
				throw new Error('polymorphic: invalid argument "' + argument + '" in signature "' + signature + '"');
			}
			else if (result.type === '...' && index < all.length - 1) {
				throw new Error('polymorphic: variadic argument must be at end of signature "' + signature + '"');
			}

			return result;
		}).filter(function(argument) {
			//  a type is undefined if it was declared as 'void' or '' (an empty string)
			return argument.type !== undefined;
		});
	}
function parse(signature) {
		var pattern = /^(?:void|([a-zA-Z]+!?|\.{3})(?:[:\s]+([a-zA-Z]+)(?:(=)(@)?(.*))?)?)?$/;

		return signature.split(/\s*,\s*/).map(function(argument, index, all) {
			var result = prepareArgument(argument.match(pattern), 'var' + (index + 1));

			if (result.type === false) {
				throw new Error('polymorphic: invalid argument "' + argument + '" in signature "' + signature + '"');
			}
			else if (result.type === '...' && index < all.length - 1) {
				throw new Error('polymorphic: variadic argument must be at end of signature "' + signature + '"');
			}

			return result;
		}).filter(function(argument) {
			//  a type is undefined if it was declared as 'void' or '' (an empty string)
			return argument.type !== undefined;
		});
	}
function parse ( signature ) { var pattern = / ^(?:void|([a-zA-Z]+!?|\.{3})(?:[:\s]+([a-zA-Z]+)(?:(=)(@)?(.*))?)?)?$ / ; return signature . split ( / \s*,\s* / ) . map ( function ( argument , index , all ) { var result = prepareArgument ( argument . match ( pattern ) , 'var' + ( index + 1 ) ) ; if ( result . type === false ) { throw new Error ( 'polymorphic: invalid argument "' + argument + '" in signature "' + signature + '"' ) ; } else if ( result . type === '...' && index < all . length - 1 ) { throw new Error ( 'polymorphic: variadic argument must be at end of signature "' + signature + '"' ) ; } return result ; } ) . filter ( function ( argument ) { //  a type is undefined if it was declared as 'void' or '' (an empty string) return argument . type !== undefined ; } ) ; }
Parse given signature string and create an array containing all argument options for the signature
@name    parse
@access  internal
@param   string  signature
@return  array   options
Parse given signature string and create an array containing all argument options for the signature