MCPcopy Create free account
hub / github.com/axios/axios / constructor

Method constructor

bin/GithubAPI.js:10–24  ·  view source on GitHub ↗
(owner, repo)

Source from the content-addressed store, hash-verified

8
9export default class GithubAPI {
10 constructor(owner, repo) {
11 if (!owner) {
12 throw new Error('repo owner must be specified');
13 }
14
15 if (!repo) {
16 throw new Error('repo must be specified');
17 }
18
19 this.repo = repo;
20 this.owner = owner;
21 this.axios = githubAxios.create({
22 baseURL: `https://api.github.com/repos/${this.owner}/${this.repo}/`,
23 })
24 }
25
26 async createComment(issue, body) {
27 return (await this.axios.post(`/issues/${issue}/comments`, {body})).data;

Callers

nothing calls this directly

Calls 1

createMethod · 0.80

Tested by

no test coverage detected