function factory( mode ) {
	if ( !isIndexMode( mode ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be a recognized index mode. Value: `%s`.', mode ) );
	}
	return TABLE[ mode ];
}
Returns a function for returning an index according to a provided index mode.

@param {string} mode - specifies how to handle an out-of-bounds index
@throws {TypeError} first argument must be a recognized index mode
@returns {Function} function for returning an index

@example
var ind = factory( 'clamp' );

var idx = ind( 2, 9 );
// returns 2

idx = ind( 10, 9 );
// returns 9

idx = ind( -1, 9 );
// returns 0

@example
var ind = factory( 'wrap' );

var idx = ind( 2, 9 );
// returns 2

idx = ind( 10, 9 );
// returns 0

idx = ind( -1, 9 );
// returns 9

@example
var ind = factory( 'throw' );

var idx = ind( 2, 9 );
// returns 2

idx = ind( 10, 9 );
// throws <RangeError>

idx = ind( -1, 9 );
// throws <RangeError>

@example
var ind = factory( 'normalize' );

var idx = ind( 1, 10 );
// returns 1

idx = ind( -4, 10 );
// returns 7

idx = ind( -100, 10 );
// throws <RangeError>