You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've run into an interesting issue when submitting a PR for npm's arborist library, where a range (e.g. ~3.5.0) is not a subset of any. This should be supported, as even though any is not a subset of a range (which is already handled), the opposite is not the case.
I think the fix would be to add an additional short-circuit check in lines 58-62 (v7.3.4 snippet) to handle an any dom value:
if (sub === dom)
return true
+ if (dom.length === 1 && dom[0].semver === ANY)+ return true
if (sub.length === 1 && sub[0].semver === ANY)
return dom.length === 1 && dom[0].semver === ANY
When
I run a subset comparison for if a given range is a subset of any
What / Why
I've run into an interesting issue when submitting a PR for npm's arborist library, where a range (e.g.
~3.5.0
) is not a subset of any. This should be supported, as even though any is not a subset of a range (which is already handled), the opposite is not the case.I think the fix would be to add an additional short-circuit check in lines 58-62 (v7.3.4 snippet) to handle an any
dom
value:When
I run a subset comparison for if a given range is a subset of any
Example
Current Behavior
Result is falsey.
Expected Behavior
Result should be truthy, as
>=3.5.0 <3.6.0-0
should be a subset of any.References
The text was updated successfully, but these errors were encountered: