source/common.js
function alias(path, aliases)
{
	// if it's a path to a file - don't interfere
	if (!is_package_path(path))
	{
		return
	}

	// extract module name from the path
	const slash_index = path.indexOf('/')
	const module_name = slash_index >= 0 ? path.substring(0, slash_index) : path
	const rest = slash_index >= 0 ? path.substring(slash_index) : ''

	// find an alias
	const alias = aliases[module_name]

	// if an alias is found, require() the correct path
	if (alias)
	{
		return alias + rest
	}
}
function alias(path, aliases)
{
	// if it's a path to a file - don't interfere
	if (!is_package_path(path))
	{
		return
	}

	// extract module name from the path
	const slash_index = path.indexOf('/')
	const module_name = slash_index >= 0 ? path.substring(0, slash_index) : path
	const rest = slash_index >= 0 ? path.substring(slash_index) : ''

	// find an alias
	const alias = aliases[module_name]

	// if an alias is found, require() the correct path
	if (alias)
	{
		return alias + rest
	}
}
function alias ( path , aliases ) { // if it's a path to a file - don't interfere if ( ! is_package_path ( path ) ) { return } // extract module name from the path const slash_index = path . indexOf ( '/' ) const module_name = slash_index >= 0 ? path . substring ( 0 , slash_index ) : path const rest = slash_index >= 0 ? path . substring ( slash_index ) : '' // find an alias const alias = aliases [ module_name ] // if an alias is found, require() the correct path if ( alias ) { return alias + rest } }
alias the path provided the aliases map
alias the path provided the aliases map