How to use the @octokit/rest/package.json.version function in @octokit/rest

To help you get started, we’ve selected a few @octokit/rest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / opensource-portal / lib / github / index.ts View on Github external
this.redis = redis;

    const linkProvider = options.linkProvider as ILinkProvider;
    if (!linkProvider) {
      throw new Error('No link provider included in the options to the library context constructor');
    }
    this.linkProvider = linkProvider;

    let config = options.config;
    if (!config) {
      throw new Error('No runtime configuration instance provided to the library context constructor');
    }

    let memoryCache = options.memoryCache || new Map();

    const nodeGithubVersion = `${githubPackage.name}/${githubPackage.version}`;
    let userAgent = nodeGithubVersion;
    if (config && config.github && config.github.library && config.github.library.userAgent) {
      userAgent = config.github.library.userAgent;
    }
    let github = options.github;
    if (!github) {
      let githubApi = options.GitHubApi || GitHubApi;
      github = new githubApi({
        userAgent,
      });
    }
    this.github = github;

    this.defaultPageSize = config && config.github && config.github.api && config.github.api.defaultPageSize ? config.github.api.defaultPageSize : 100,
    this.breakingChangeGitHubPackageVersion = breakingChangeGitHubPackageVersion;