function rank( order, regexps, name ) {
	var type;
	var i;

	type = 'external';
	if ( isNodeBuiltin( name ) ) {
		type = 'builtin';
	} else if (
		startsWith( name, './' ) ||
		startsWith( name, '/' ) ||
		startsWith( name, '../' )
	) {
		type = 'path';
	}
	for ( i = 0; i < regexps.length; i++ ) {
		if ( regexps[ i ].test( name ) ) {
			type = '/'+regexps[ i ].source+'/';
			break;
		}
	}
	return indexOf( order, type );
}
Calculates the "rank" of a `require` path.

@private
@param {StringArray} order - require statement order
@param {Array<RegExp>} regexps - regular expression array for detecting custom require statement types
@param {string} name - require path
@returns {integer} path rank