Skip to content
Last Updated
Mar 28, 2025, 03:08

Fabric Semetic Version Module ​

npm versionDownloadsInstall sizenpmBuild Status

Port the fabric special sementic version algorithm to typescript.

ts
import { parseVersionRange, FabricSemanticVersion } from "@xmcl/semver";

const versionRangeString = ">=1.0+fabric+minecraft"; // this is invalid as a normal semver but valid here
const versionRange = parseVersionRange(versionRangeString);

const versionString = "1.21"; // a Minecraft version
const semver = parseSemanticVersion(versionString);

const isVersionInRange = versionRange.test(semver); // is version in this version range

🧾 Classes ​

🤝 Interfaces ​

🏭 Functions ​

parseSemanticVersion ​

ts
parseSemanticVersion(version: string, storeX: boolean= true): FabricSemanticVersion

Parameters ​

  • version: string
  • storeX: boolean

Return Type ​

  • FabricSemanticVersion

Defined in: packages/semver/semver.ts:255

parseVersionRange ​

ts
parseVersionRange(rangeString: string): VersionRange

Parse the version range string.

Parameters ​

  • rangeString: string The version range string

Return Type ​

  • VersionRange

Defined in: packages/semver/range.ts:130