import { isBreaking } from "../semver/index.js";
import { getNewValue } from "./range.js";
import semver from "semver";
import stable from "semver-stable";

//#region lib/modules/versioning/npm/index.ts
const id = "npm";
const { compare: sortVersions, maxSatisfying: getSatisfyingVersion, minSatisfying: minSatisfyingVersion, major: getMajor, minor: getMinor, patch: getPatch, satisfies: matches, valid: valid$1, validRange, ltr: isLessThanRange, gt: isGreaterThan, eq: equals, subset, intersects } = semver;
const isValid = (input) => !!validRange(input);
const isVersion = (input) => !!valid$1(input);
function isSingleVersion(constraint) {
	return isVersion(constraint) || constraint?.startsWith("=") && isVersion(constraint.substring(1).trim());
}
const api = {
	equals,
	getMajor,
	getMinor,
	getNewValue,
	getPatch,
	isBreaking,
	isCompatible: isVersion,
	isGreaterThan,
	isLessThanRange,
	isSingleVersion,
	isStable: stable.is,
	isValid,
	isVersion,
	matches,
	getSatisfyingVersion,
	minSatisfyingVersion,
	sortVersions,
	subset,
	intersects
};

//#endregion
export { api as default, id, isValid, isVersion };
//# sourceMappingURL=index.js.map