Spaces:
Paused
Paused
Download console/src/utils/pluginCompatibility.ts from mysticaldragon/HF: direct link, hf CLI and curl.
- Browser
- Download file 643 Bytes
-
https://huggingface.co/spaces/mysticaldragon/HF/resolve/main/console/src/utils/pluginCompatibility.ts
- Command line
-
hf download hf://spaces/mysticaldragon/HF/console/src/utils/pluginCompatibility.ts
-
curl -L -o pluginCompatibility.ts https://huggingface.co/spaces/mysticaldragon/HF/resolve/main/console/src/utils/pluginCompatibility.ts
643 Bytes
| import type { MarketPluginEntry } from "@/api/modules/pluginMarket"; | |
| function deriveCompatLabel(version: string): string | null { | |
| const trimmed = version.trim().replace(/^v/i, ""); | |
| const match = trimmed.match(/^(\d+)/); | |
| if (!match) return null; | |
| return `${match[1]}.x`; | |
| } | |
| export function isMarketPluginCompatible( | |
| entry: MarketPluginEntry, | |
| currentVersion: string | null, | |
| ): boolean { | |
| if (!currentVersion) return true; | |
| const labels = entry.qwenpaw_compat_labels; | |
| if (!labels || labels.length === 0) return true; | |
| const label = deriveCompatLabel(currentVersion); | |
| if (!label) return true; | |
| return labels.includes(label); | |
| } | |