summaryrefslogtreecommitdiff
path: root/src/modules/about/utils.ts
blob: b9d5af29330f1003e0ffb250ba9254dd3baacbc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
type VersionData = {
  version?: string;
  premium?: boolean;
  meta?: boolean;
};

export function getCoreVersionMeta(version?: VersionData) {
  if (!version?.version) {
    return null;
  }

  if (version.meta && version.premium) {
    return {
      name: 'sing-box',
      link: 'https://github.com/SagerNet/sing-box',
    };
  }

  if (version.meta) {
    return {
      name: 'Clash.Meta',
      link: 'https://github.com/MetaCubeX/Clash.Meta',
    };
  }

  return {
    name: 'Clash',
    link: 'https://github.com/Dreamacro/clash',
  };
}