Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;