function name2bucket( name, buckets ) {
	var out;
	var n;
	var i;
	if ( !isPositiveInteger( buckets ) ) {
		throw new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', buckets ) );
	}
	if ( isString( name ) ) {
		return hash( name2standalone( name ), buckets );
	}
	if ( !isArrayLikeObject( name ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be either a string or an array of strings. Value: `%s`.', name ) );
	}
	if ( !isPositiveInteger( buckets ) ) {
		throw new TypeError( format( 'invalid argument. Second argument must be a positive integer. Value: `%s`.', buckets ) );
	}
	out = [];
	for ( i = 0; i < name.length; i++ ) {
		n = name[ i ];
		if ( !isString( n ) ) {
			throw new TypeError( format( 'invalid argument. First argument must be either a string or an array of strings. Value: `%s`. Index: `%u`.', n, i ) );
		}
		out.push( hash( name2standalone( n ), buckets ) );
	}
	return out;
}
Deterministically converts a package name (or list of package names) to a bucket.

## Notes

-   The package ensures that standalone and non-standalone package names map to the same bucket.

@param {(string|StringArray)} name - package name(s)
@param {PositiveInteger} buckets - number of buckets
@throws {TypeError} first argument must be a string or an array of strings
@throws {TypeError} second argument must be a positive integer
@returns {(NonNegativeInteger|NonNegativeIntegerArray)} bucket(s)

@example
var out = name2bucket( '@stdlib/math/base/special/sin', 10 );
// returns <number>

@example
var pkgs = [
    '@stdlib/math/base/special/sin'
];

var out = name2bucket( pkgs, 10 );
// returns [ <number> ]