lib/modules.js
function resolve(parent, id) {
	if (/^\.\.?\//.test(id) && parent) { // is a relative id
		id = parent.replace(/[^\/]+$/, id); // prepend parent's dirname
	}
	var terms = [];
	id.split('/').forEach(function(term) {
		if ('..' === term) { terms.pop(); } // remove previous, don't add ..
		else if ('.' !== term) { terms.push(term); } // add term
		// else if ('.' === term) // ignore .
	});
	return terms.join('/');
}
function resolve(parent, id) {
	if (/^\.\.?\//.test(id) && parent) { // is a relative id
		id = parent.replace(/[^\/]+$/, id); // prepend parent's dirname
	}
	var terms = [];
	id.split('/').forEach(function(term) {
		if ('..' === term) { terms.pop(); } // remove previous, don't add ..
		else if ('.' !== term) { terms.push(term); } // add term
		// else if ('.' === term) // ignore .
	});
	return terms.join('/');
}
function resolve ( parent , id ) { if ( / ^\.\.?\/ / . test ( id ) && parent ) { // is a relative id id = parent . replace ( / [^\/]+$ / , id ) ; // prepend parent's dirname } var terms = [ ] ; id . split ( '/' ) . forEach ( function ( term ) { if ( '..' === term ) { terms . pop ( ) ; } // remove previous, don't add .. else if ( '.' !== term ) { terms . push ( term ) ; } // add term // else if ('.' === term) // ignore . } ) ; return terms . join ( '/' ) ; }
Turn a relative id to absolute given a parent id
Turn a relative id to absolute given a parent id