function toFlat( pkgs ) {
	var keys;
	var tmp;
	var out;
	var key;
	var id;
	var i;

	tmp = {};
	for ( i = 0; i < pkgs.length; i++ ) {
		id = pkgs[ i ];

		debug( 'Converting package %s to an alias...', id );
		key = pkg2alias( id );

		// Check for a duplicate key...
		if ( hasOwnProp( tmp, key ) ) {
			debug( 'WARNING: found a duplicate key: %s. Overriding currently assigned alias.', key );
		}
		debug( 'Mapping package %s to alias %s.', id, key );
		tmp[ key ] = id;
	}
	keys = objectKeys( tmp );
	out = new Array( keys.length );
	for ( i = 0; i < keys.length; i++ ) {
		key = keys[ i ];
		out[ i ] = [ key, tmp[ key ] ];
	}
	return out;
}
Converts a list of packages to a flat namespace.

@private
@param {StringArray} pkgs - list of packages (sorted lexicographically)
@returns {ArrayArray} package namespace where the first element is the package alias and the second element is the package identifier

@example
var pkgs = [
    '@stdlib/math/base/special/erf',
    '@stdlib/math/base/special/erfc',
    'tape'
];

var out = toFlat( pkgs );
// e.g., returns [ [ 'base.erf', '@stdlib/math/base/special/erf' ], [ 'base.erfc', '@stdib/math/base/special/erfc' ], [ 'tape', 'tape' ] ]