lib/map.js
function transfer(root, map, opts) {
	map = filter(map, opts);
	var folders = [];

	function getIndex(k) {
		var index = k;
		if (opts.relative) {
			var replace = opts.relative === true ? (root._path + path.sep) : opts.relative;
			index =  k.replace(replace, '');
		}
		return index;
	}

	Object.keys(map).forEach(function (k) {
		var index = getIndex(map[k]._path);

		if (map[k]._type === 'directory') {
			folders.push(map[k]);
			if (opts.type !== 'file' && !(opts.match || opts.ext)) {
				root[index] = map[k];
			}
		}
		if (map[k]._type === 'file' && (!opts.type || opts.type === 'file')) {
			root[index] = map[k];
		}
	});

	return folders;
}
function transfer(root, map, opts) {
	map = filter(map, opts);
	var folders = [];

	function getIndex(k) {
		var index = k;
		if (opts.relative) {
			var replace = opts.relative === true ? (root._path + path.sep) : opts.relative;
			index =  k.replace(replace, '');
		}
		return index;
	}

	Object.keys(map).forEach(function (k) {
		var index = getIndex(map[k]._path);

		if (map[k]._type === 'directory') {
			folders.push(map[k]);
			if (opts.type !== 'file' && !(opts.match || opts.ext)) {
				root[index] = map[k];
			}
		}
		if (map[k]._type === 'file' && (!opts.type || opts.type === 'file')) {
			root[index] = map[k];
		}
	});

	return folders;
}
function transfer ( root , map , opts ) { map = filter ( map , opts ) ; var folders = [ ] ; function getIndex ( k ) { var index = k ; if ( opts . relative ) { var replace = opts . relative === true ? ( root . _path + path . sep ) : opts . relative ; index = k . replace ( replace , '' ) ; } return index ; } Object . keys ( map ) . forEach ( function ( k ) { var index = getIndex ( map [ k ] . _path ) ; if ( map [ k ] . _type === 'directory' ) { folders . push ( map [ k ] ) ; if ( opts . type !== 'file' && ! ( opts . match || opts . ext ) ) { root [ index ] = map [ k ] ; } } if ( map [ k ] . _type === 'file' && ( ! opts . type || opts . type === 'file' ) ) { root [ index ] = map [ k ] ; } } ) ; return folders ; }
Function for transferring properties from map to root using opts

@param root {Object} - object to attach new pointers to
@param map {Object} - object with properties being pointer objects
@param opts {Object} - options
@returns {Array} - Folders for recursive mapping
Function for transferring properties from map to root using opts