@code-pushup/js-packages-plugin
Version:
Code PushUp plugin for JavaScript packages 🛡️
14 lines • 727 B
JavaScript
import { objectToEntries } from '@code-pushup/utils';
export function npmToOutdatedResult(output) {
const npmOutdated = JSON.parse(output);
// "current" might be missing in some cases, usually it is missing if the dependency is not installed, fallback to "wanted" should avoid this problem
// https://stackoverflow.com/questions/42267101/npm-outdated-command-shows-missing-in-current-version
return objectToEntries(npmOutdated).map(([name, overview]) => ({
name,
current: overview.current || overview.wanted,
latest: overview.latest,
type: overview.type,
...(overview.homepage != null && { url: overview.homepage }),
}));
}
//# sourceMappingURL=outdated-result.js.map