mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-23 15:34:20 +01:00
* Fix npm view --json returning array in npm 12+
npm 12 changed npm view --json to always return an array [{...}]
instead of {...}. Handle both formats by checking Array.isArray.
Fixes #327228
* Extract npm view output parsing into a testable module with tests
Move the `npm view --json` parsing out of `npmView()` into a pure
`parseNpmViewOutput()` function so the npm 12+ array-format fix can be
unit tested without the vscode API. Add a mocha suite covering object
and array output, dist-tags.latest preference and fallback, missing
fields, invalid and non-object output, and register the npm extension
in .vscode-test.js so CI runs the tests.