import semver from 'semver' ; import stable from 'semver-stable' ; import type { NewValueConfig , VersioningApi } from '../types' ; export const id = 'semver' ; export const displayName = 'Semantic' ; export const urls = [ 'https://semver.org/' ] ; export const supportsRanges = false ; const { is : isStable } = stable ; const { compare : sortVersions , maxSatisfying : getSatisfyingVersion , minSatisfying : minSatisfyingVersion , major : getMajor , minor : getMinor , patch : getPatch , satisfies : matches , valid , ltr : isLessThanRange , gt : isGreaterThan , eq : equals , } = semver ; export const isVersion = ( input ) : boolean => ! ! valid ( input ) ; export { isVersion as isValid , getSatisfyingVersion } ; function getNewValue ( { newVersion } ) { return newVersion ; } function isCompatible ( version ) { return isVersion ( version ) ; } function isSingleVersion ( version ) { return isVersion ( version ) ; } function isValid ( input ) { return isVersion ( input ) ; } export const api = { equals , getMajor , getMinor , getPatch , isCompatible , isGreaterThan , isLessThanRange , isSingleVersion , isStable , isValid , isVersion , matches , getSatisfyingVersion , minSatisfyingVersion , getNewValue , sortVersions , } ; export default api ;