Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor () {
// load base paths where plugins might be installed
this.paths = this.getBasePaths()
// setup requests with default options
this.rp = rp.defaults({json: true})
// get npm path
this.npm = this.getNpmPath()
// pre-load installed plugins
this.plugins = []
this.getInstalled()
}
constructor() {
// load base paths where plugins might be installed
this.paths = this.getBasePaths();
// setup requests with default options
this.rp = rp.defaults({ json: true });
// get npm path
this.npm = this.getNpmPath();
// pre-load installed plugins
this.plugins = [];
this.getInstalled();
}
constructor(owner, repo, token) {
this.owner = owner;
this.repo = repo;
this.token = token;
this.rp = request.defaults({
baseUrl: `${GH_HOST}/repos/${this.owner}/${this.repo}`,
headers: {
// Opt-in into the preview version in order to be able to work with label descriptions
// See
Accept: 'application/vnd.github.symmetra-preview+json',
'user-agent': 'gh-label',
},
json: true
});
}
constructor(client) {
this.client = client;
this.jar = Request.jar();
this.options = {
timeout: 5000,
headers: { },
json: true,
jar: this.jar,
};
this.request = Request.defaults(this.options);
}
constructor (settings) {
this.client = request.defaults({
baseUrl: 'https://api.travis-ci.org',
headers: {
'Content-Type': 'application/json',
'Travis-API-Version': '3',
Authorization: `token ${settings.token}`
},
json: true
});
}