classes/BowerMap.js
function getComponentMapping( name, files ) {
		grunt.verbose.writeln( 'BowerMap::getComponentMapping - ' + name );


		//first get list of all files
		var fileList = [];
		if ( shim[ name ] !== undefined ) {
			grunt.verbose.writeln( '    using shim value' );
			//use shim value
			fileList = fileList.concat( shim[ name ] );
		}
		else {
			grunt.verbose.writeln( '    using result value - ' + files );
			//make sure files is an array
			if (typeof files === 'string'){
				files = [files];
			}
			//we just need the path relative to the module directory
			files.forEach( function( file ){
				file = path.fix( file );
				fileList.push( file.replace( path.fix( path.join( bowerPath, name ) ) , "" ) );
			});
		}

		//expand list
		var expandedList = [];
		fileList.forEach( function( file ){
			grunt.verbose.writeln( '      globbing - ' + path.join( name, file ) );
			glob.sync( path.join( name, file ), { cwd: bowerPath, dot: true } ).forEach( function( filename ) {
				var src = path.fix( path.join( bowerPath, filename ) );
				grunt.verbose.writeln( 'src      ' + src );
				expandedList.push( src );
			});
		});

		//filter filetypes
		expandedList = expandedList.filter( function( file ){
			var ext = path.extname( file ).substr(1);
			if ( extensions ){
				return extensions.indexOf( ext ) >= 0;
			}
			else{
				return true;
			}
		});


		//get common path for building destination
		var commonPath = maintainCommonPaths ? "" : getCommonPathBase( expandedList );
		grunt.verbose.writeln( '   common path: ' + commonPath );


		//build default mapping
		var componentMap = {};
		grunt.verbose.writeln( '   mapping files:' );
		expandedList.forEach( function( file ){

			if ( expandedMap[ file ] !== undefined ) {
				//use user configured mapping if set
				componentMap[ file ] = expandedMap[ file ];
				grunt.log.writeln( '  * '+file+' -> '+ expandedMap[ file ] );
			}
			else {
				var newFilename = commonPath === "" ? file : file.replace( commonPath, "" );
				//console.log('      newfileName:',newFilename);
				var dest = path.join( destPath, newFilename );
				//console.log('      dest:',dest);

				if ( useNamespace === true || ( useNamespace === undefined && expandedList.length > 1 ) ){
					dest = dest.replace( destPath, path.join( destPath, name ) );
				}
				componentMap[ file ] = dest;
				grunt.log.writeln( '    '+file+' -> '+ dest );

			}

		});

		return componentMap;

	}
function getComponentMapping( name, files ) {
		grunt.verbose.writeln( 'BowerMap::getComponentMapping - ' + name );


		//first get list of all files
		var fileList = [];
		if ( shim[ name ] !== undefined ) {
			grunt.verbose.writeln( '    using shim value' );
			//use shim value
			fileList = fileList.concat( shim[ name ] );
		}
		else {
			grunt.verbose.writeln( '    using result value - ' + files );
			//make sure files is an array
			if (typeof files === 'string'){
				files = [files];
			}
			//we just need the path relative to the module directory
			files.forEach( function( file ){
				file = path.fix( file );
				fileList.push( file.replace( path.fix( path.join( bowerPath, name ) ) , "" ) );
			});
		}

		//expand list
		var expandedList = [];
		fileList.forEach( function( file ){
			grunt.verbose.writeln( '      globbing - ' + path.join( name, file ) );
			glob.sync( path.join( name, file ), { cwd: bowerPath, dot: true } ).forEach( function( filename ) {
				var src = path.fix( path.join( bowerPath, filename ) );
				grunt.verbose.writeln( 'src      ' + src );
				expandedList.push( src );
			});
		});

		//filter filetypes
		expandedList = expandedList.filter( function( file ){
			var ext = path.extname( file ).substr(1);
			if ( extensions ){
				return extensions.indexOf( ext ) >= 0;
			}
			else{
				return true;
			}
		});


		//get common path for building destination
		var commonPath = maintainCommonPaths ? "" : getCommonPathBase( expandedList );
		grunt.verbose.writeln( '   common path: ' + commonPath );


		//build default mapping
		var componentMap = {};
		grunt.verbose.writeln( '   mapping files:' );
		expandedList.forEach( function( file ){

			if ( expandedMap[ file ] !== undefined ) {
				//use user configured mapping if set
				componentMap[ file ] = expandedMap[ file ];
				grunt.log.writeln( '  * '+file+' -> '+ expandedMap[ file ] );
			}
			else {
				var newFilename = commonPath === "" ? file : file.replace( commonPath, "" );
				//console.log('      newfileName:',newFilename);
				var dest = path.join( destPath, newFilename );
				//console.log('      dest:',dest);

				if ( useNamespace === true || ( useNamespace === undefined && expandedList.length > 1 ) ){
					dest = dest.replace( destPath, path.join( destPath, name ) );
				}
				componentMap[ file ] = dest;
				grunt.log.writeln( '    '+file+' -> '+ dest );

			}

		});

		return componentMap;

	}
function getComponentMapping ( name , files ) { grunt . verbose . writeln ( 'BowerMap::getComponentMapping - ' + name ) ; //first get list of all files var fileList = [ ] ; if ( shim [ name ] !== undefined ) { grunt . verbose . writeln ( '    using shim value' ) ; //use shim value fileList = fileList . concat ( shim [ name ] ) ; } else { grunt . verbose . writeln ( '    using result value - ' + files ) ; //make sure files is an array if ( typeof files === 'string' ) { files = [ files ] ; } //we just need the path relative to the module directory files . forEach ( function ( file ) { file = path . fix ( file ) ; fileList . push ( file . replace ( path . fix ( path . join ( bowerPath , name ) ) , "" ) ) ; } ) ; } //expand list var expandedList = [ ] ; fileList . forEach ( function ( file ) { grunt . verbose . writeln ( '      globbing - ' + path . join ( name , file ) ) ; glob . sync ( path . join ( name , file ) , { cwd : bowerPath , dot : true } ) . forEach ( function ( filename ) { var src = path . fix ( path . join ( bowerPath , filename ) ) ; grunt . verbose . writeln ( 'src      ' + src ) ; expandedList . push ( src ) ; } ) ; } ) ; //filter filetypes expandedList = expandedList . filter ( function ( file ) { var ext = path . extname ( file ) . substr ( 1 ) ; if ( extensions ) { return extensions . indexOf ( ext ) >= 0 ; } else { return true ; } } ) ; //get common path for building destination var commonPath = maintainCommonPaths ? "" : getCommonPathBase ( expandedList ) ; grunt . verbose . writeln ( '   common path: ' + commonPath ) ; //build default mapping var componentMap = { } ; grunt . verbose . writeln ( '   mapping files:' ) ; expandedList . forEach ( function ( file ) { if ( expandedMap [ file ] !== undefined ) { //use user configured mapping if set componentMap [ file ] = expandedMap [ file ] ; grunt . log . writeln ( '  * ' + file + ' -> ' + expandedMap [ file ] ) ; } else { var newFilename = commonPath === "" ? file : file . replace ( commonPath , "" ) ; //console.log('      newfileName:',newFilename); var dest = path . join ( destPath , newFilename ) ; //console.log('      dest:',dest); if ( useNamespace === true || ( useNamespace === undefined && expandedList . length > 1 ) ) { dest = dest . replace ( destPath , path . join ( destPath , name ) ) ; } componentMap [ file ] = dest ; grunt . log . writeln ( '    ' + file + ' -> ' + dest ) ; } } ) ; return componentMap ; }
gets file mapping for specified component
@param name
@param files
@returns {{}}
gets file mapping for specified component