function pkg2alias( id, flg ) {
	var alias;
	if ( hasOwnProp( aliases, id ) ) {
		alias = aliases[ id ];
		debug( 'Found a known alias for package %s: %s.', id, alias );
		if ( flg === false ) {
			debug( 'Extracting alias basename...' );
			alias = alias.split( '.' );
			alias = alias[ alias.length-1 ];
		}
	} else {
		debug( 'Failed to map package %s to a known alias.', id );

		alias = basename( id );
		debug( 'Package basename: %s.', alias );

		alias = camelcase( alias );
		debug( 'Generated alias: %s.', alias );
	}
	return alias;
}
Maps a package name to an alias.

@private
@param {string} id - package name
@param {boolean} [flg=true] - boolean flag indicating whether, for known aliases, to return a full alias (e.g., `base.dist.cosine.pdf`) or alias basename (e.g., `pdf`)
@returns {string} alias

@example
var out = pkg2alias( '@stdlib/math/base/special/erf' );
// e.g., returns 'base.erf'

@example
var out = pkg2alias( '@stdlib/math/base/special/erf', true );
// e.g., returns 'base.erf'

@example
var out = pkg2alias( '@stdlib/math/base/special/erf', false );
// e.g., returns 'erf'

@example
var out = pkg2alias( '@stdlib/math/base/special/beep-boop' );
// returns 'beepBoop'

@example
var out = pkg2alias( 'tape' );
// returns 'tape'

@example
var out = pkg2alias( 'foo-bar' );
// returns 'fooBar'