This commit is contained in:
Dan Schulte 2018-10-12 15:03:03 -07:00
Родитель 25536e7f5f
Коммит 345aac9101
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -311,7 +311,7 @@ export function getLocalDependencyVersion(dependencyName: string): string {
} }
export function getPreviewDependencyVersion(dependencyName: string): string | undefined { export function getPreviewDependencyVersion(dependencyName: string): string | undefined {
let version: string | undefined = addTildePrefix(getNpmPackageVersion(dependencyName, "preview")); let version: string | undefined = addCaretPrefix(getNpmPackageVersion(dependencyName, "preview"));
if (!version) { if (!version) {
version = getLatestDependencyVersion(dependencyName); version = getLatestDependencyVersion(dependencyName);
} }
@ -319,9 +319,9 @@ export function getPreviewDependencyVersion(dependencyName: string): string | un
} }
export function getLatestDependencyVersion(dependencyName: string): string | undefined { export function getLatestDependencyVersion(dependencyName: string): string | undefined {
return addTildePrefix(getNpmPackageVersion(dependencyName, "latest")); return addCaretPrefix(getNpmPackageVersion(dependencyName, "latest"));
} }
function addTildePrefix(version: string | undefined): string | undefined { function addCaretPrefix(version: string | undefined): string | undefined {
return version ? `~${version}` : version; return version ? `^${version}` : version;
} }