function getVersionedDep(dep, versions) {
	// Handle non-registry packages (Github, bitbucket, etc.)
	if (!validateNpmPackageName(dep).validForNewPackages) {
		// If we were explicitly passed a version, attempt to
		// load it via the `#semver:<semver>` syntax.
		if (versions[dep]) {
			return `${dep}#semver:${versions[dep]}`;
		} else {
			return dep;
		}
	}
	const version = versions[dep] || 'latest';
	return `${dep}@${version}`;
}
Add version or latest to package name
@param {string} dep
@param {Record<string, string>} versions