Files
nvm/test/fast/Unit tests
Jordan Harband 8df635740e [Fix] nvm_remote_version: match the requested version as a whole version component
The check that the resolved version actually matches the request used an unanchored substring match on the raw pattern,
so `nvm install 20` could accept `v10.20.0` when a remote list's row was selected by a `v20` in its LTS column and no 20.x rows were present.

Match the `v`-prefixed pattern followed by a non-digit against the version instead,
the same way `nvm_ls_remote_index_tab` normalizes it,
so `20` no longer matches `v10.20.0` or `v200.0.0`,
while regex-style requests like `4.*` and `v[68]`,
and a trailing dot like `8.`, keep working.
This also fixes `iojs-1` and `iojs-3`,
which previously resolved to N/A because `iojs-3` is not a substring of `iojs-v3.3.1`.

Discovered by Anthropic's OSS Scanner, as bug ANT-2026-7GFFYVJP; the scanner correctly classified it as not a vulnerability.
2026-10-22 20:10:42 -07:00
..