mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-27 15:58:48 +00:00
35 lines
669 B
TypeScript
35 lines
669 B
TypeScript
import { NewValueConfig, VersioningApi } from '../common';
|
|
import npm, { isValid, isVersion } from '../npm';
|
|
|
|
export const id = 'node';
|
|
export const displayName = 'Node.js';
|
|
export const urls = [];
|
|
export const supportsRanges = false;
|
|
|
|
function getNewValue({
|
|
currentValue,
|
|
rangeStrategy,
|
|
fromVersion,
|
|
toVersion,
|
|
}: NewValueConfig): string {
|
|
const res = npm.getNewValue({
|
|
currentValue,
|
|
rangeStrategy,
|
|
fromVersion,
|
|
toVersion,
|
|
});
|
|
if (isVersion(res)) {
|
|
// normalize out any 'v' prefix
|
|
return isVersion(res);
|
|
}
|
|
return res;
|
|
}
|
|
|
|
export { isValid };
|
|
|
|
export const api: VersioningApi = {
|
|
...npm,
|
|
getNewValue,
|
|
};
|
|
export default api;
|