ChemPal Documentation - v1.6.0
    Preparing search index...

    Function getReleaseByTag

    • Fetches a specific release by tag. Used on the Web Store path, where chrome.runtime.onUpdateAvailable reports only a version number and the release notes have to be looked up separately.

      Parameters

      • version: string

        The version to look up, with or without a leading v.

      Returns Promise<undefined | GithubRelease>

      The release, or undefined if it couldn't be retrieved.

      const release = await getReleaseByTag("1.3.0");
      release?.html_url; // "https://github.com/owner/repo/releases/tag/v1.3.0"
      export async function getReleaseByTag(version: string): Promise<GithubRelease | undefined> {
      const tag = `v${normalizeVersion(version)}`;
      return fetchRelease(`releases/tags/${encodeURIComponent(tag)}`);
      }