Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

450 B
Raw Blame
// Release links accept calendar releases YY.MM.N[-rc.K] and historical 0.x releases.
const isReleaseVersion = (version: string): boolean =>
  /^(?:[1-9]\d\.(?:0[1-9]|1[0-2])\.(?:0|[1-9]\d*)|0\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*))(?:-rc\.[1-9]\d*)?$/.test(version);

export const getReleaseTag = (version: string): string | undefined => {
  if (!isReleaseVersion(version)) return undefined;
  return version.startsWith("0.") ? `v${version}` : version;
};