lib/polymorphic.js
function delegate(arg) {
		//  create a list of possible candidates based on the given arguments
		var candidate = matchSignature(registry, arg);

		//  prepare the configured signatures/arguments based on the arguments actually recieved
		candidate = prepare(candidate, arg);

		//  prioritize the candidates
		candidate = prioritize(candidate, arg);

		//  and finally, filter any candidate which does not fully comply with the signature based on the - now - parameters
		candidate = candidate.filter(function(item) {
			var variadic = false,
				min = item.arguments.map(function(argument, index) {
					variadic = isTypeAtIndex('...', item.arguments, index) || isTypeAtIndex('...', item.arguments, index + 1);

					return +(!(variadic || 'value'  in argument || 'reference' in argument));
				}).join('').match(/^1+/);

			return arg.length >= (min ? min[0].length : 0);
		});

		return candidate.length ? parameterize(candidate[0]) : false;
	}
function delegate(arg) {
		//  create a list of possible candidates based on the given arguments
		var candidate = matchSignature(registry, arg);

		//  prepare the configured signatures/arguments based on the arguments actually recieved
		candidate = prepare(candidate, arg);

		//  prioritize the candidates
		candidate = prioritize(candidate, arg);

		//  and finally, filter any candidate which does not fully comply with the signature based on the - now - parameters
		candidate = candidate.filter(function(item) {
			var variadic = false,
				min = item.arguments.map(function(argument, index) {
					variadic = isTypeAtIndex('...', item.arguments, index) || isTypeAtIndex('...', item.arguments, index + 1);

					return +(!(variadic || 'value'  in argument || 'reference' in argument));
				}).join('').match(/^1+/);

			return arg.length >= (min ? min[0].length : 0);
		});

		return candidate.length ? parameterize(candidate[0]) : false;
	}
function delegate ( arg ) { //  create a list of possible candidates based on the given arguments var candidate = matchSignature ( registry , arg ) ; //  prepare the configured signatures/arguments based on the arguments actually recieved candidate = prepare ( candidate , arg ) ; //  prioritize the candidates candidate = prioritize ( candidate , arg ) ; //  and finally, filter any candidate which does not fully comply with the signature based on the - now - parameters candidate = candidate . filter ( function ( item ) { var variadic = false , min = item . arguments . map ( function ( argument , index ) { variadic = isTypeAtIndex ( '...' , item . arguments , index ) || isTypeAtIndex ( '...' , item . arguments , index + 1 ) ; return + ( ! ( variadic || 'value' in argument || 'reference' in argument ) ) ; } ) . join ( '' ) . match ( / ^1+ / ) ; return arg . length >= ( min ? min [ 0 ] . length : 0 ) ; } ) ; return candidate . length ? parameterize ( candidate [ 0 ] ) : false ; }
Determine the proper delegate handler for given arguments
@name    delegate
@access  internal
@param   array  arguments
@return  mixed  handler result
Determine the proper delegate handler for given arguments