MCPcopy Create free account
hub / github.com/TanStack/devtools / satisfiesVersionRange

Function satisfiesVersionRange

packages/devtools/src/tabs/semver-utils.ts:90–114  ·  view source on GitHub ↗
(
  currentVersion: string,
  minVersion?: string,
  maxVersion?: string,
)

Source from the content-addressed store, hash-verified

88 * Check if a version satisfies both min and max requirements
89 */
90export function satisfiesVersionRange(
91 currentVersion: string,
92 minVersion?: string,
93 maxVersion?: string,
94): { satisfied: boolean; reason?: string } {
95 if (!minVersion && !maxVersion) {
96 return { satisfied: true }
97 }
98
99 if (minVersion && !satisfiesMinVersion(currentVersion, minVersion)) {
100 return {
101 satisfied: false,
102 reason: `Requires v${minVersion} or higher (current: v${currentVersion})`,
103 }
104 }
105
106 if (maxVersion && !satisfiesMaxVersion(currentVersion, maxVersion)) {
107 return {
108 satisfied: false,
109 reason: `Requires v${maxVersion} or lower (current: v${currentVersion})`,
110 }
111 }
112
113 return { satisfied: true }
114}

Callers 2

buildPluginCardsFunction · 0.90

Calls 2

satisfiesMinVersionFunction · 0.85
satisfiesMaxVersionFunction · 0.85

Tested by

no test coverage detected