npm-pick-manifest
Advanced tools
Comparing version 2.2.2 to 2.2.3
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="2.2.3"></a> | ||
## [2.2.3](https://github.com/zkat/npm-pick-manifest/compare/v2.2.2...v2.2.3) (2018-10-31) | ||
### Bug Fixes | ||
* **enjoyBy:** rework semantics for enjoyBy again ([5e89b62](https://github.com/zkat/npm-pick-manifest/commit/5e89b62)) | ||
<a name="2.2.2"></a> | ||
@@ -7,0 +17,0 @@ ## [2.2.2](https://github.com/zkat/npm-pick-manifest/compare/v2.2.1...v2.2.2) (2018-10-31) |
17
index.js
@@ -46,7 +46,7 @@ 'use strict' | ||
if (type === 'tag') { | ||
if (type === 'tag' && enjoyableBy(distTags[wanted])) { | ||
target = distTags[wanted] | ||
} else if (type === 'version') { | ||
target = wanted | ||
} else if (type !== 'range') { | ||
} else if (type !== 'range' && enjoyableBy(distTags[wanted])) { | ||
throw new Error('Only tag, version, and range are supported') | ||
@@ -84,2 +84,15 @@ } | ||
if ( | ||
!target && | ||
time && | ||
type === 'tag' && | ||
distTags[wanted] && | ||
!enjoyableBy(distTags[wanted]) | ||
) { | ||
const stillFresh = versions.filter(v => | ||
enjoyableBy(v) && semver.lte(v, distTags[wanted], true) | ||
).sort(semver.rcompare) | ||
target = stillFresh[0] | ||
} | ||
const manifest = ( | ||
@@ -86,0 +99,0 @@ target && |
{ | ||
"name": "npm-pick-manifest", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"description": "Resolves a matching manifest from a package metadata document according to standard npm semver resolution rules.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
12153
107