Skip to content

Commit 599eedb

Browse files
committed
style: prettier
1 parent 2e6bb19 commit 599eedb

File tree

4 files changed

+34
-34
lines changed

4 files changed

+34
-34
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Install with `npm install @octokit/core @octokit/plugin-rest-endpoint-methods`.
3333
```js
3434
const { Octokit } = require("@octokit/core");
3535
const {
36-
restEndpointMethods
36+
restEndpointMethods,
3737
} = require("@octokit/plugin-rest-endpoint-methods");
3838
```
3939

src/endpoints-to-methods.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
RequestParameters,
55
RequestMethod,
66
Route,
7-
Url
7+
Url,
88
} from "@octokit/types";
99
import { EndpointsDefaultsAndDecorations, EndpointDecorations } from "./types";
1010
import { RestEndpointMethods } from "./generated/types";
@@ -71,7 +71,7 @@ function decorate(
7171
if (decorations.mapToData) {
7272
options = Object.assign({}, options, {
7373
data: options[decorations.mapToData],
74-
[decorations.mapToData]: undefined
74+
[decorations.mapToData]: undefined,
7575
});
7676
return requestWithDefaults(options);
7777
}

test/deprecations.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ describe("Deprecations", () => {
1212
let warnCalledCount = 0;
1313
const octokit = new MyOctokit({
1414
request: {
15-
fetch: mock
15+
fetch: mock,
1616
},
1717
log: {
1818
warn: (deprecation: Error) => {
1919
warnCalledCount++;
2020
expect(deprecation).toMatch(
2121
"octokit.reactions.delete() has been renamed to octokit.reactions.deleteLegacy()"
2222
);
23-
}
24-
}
23+
},
24+
},
2525
});
2626
// See https://developer.github.com/v3/reactions/#delete-a-reaction-legacy
2727
await octokit.reactions.delete({ reaction_id: 1 });
@@ -35,16 +35,16 @@ describe("Deprecations", () => {
3535
let warnCalledCount = 0;
3636
const octokit = new MyOctokit({
3737
request: {
38-
fetch: mock
38+
fetch: mock,
3939
},
4040
log: {
4141
warn: (deprecation: Error) => {
4242
warnCalledCount++;
4343
expect(deprecation).toMatch(
4444
"octokit.reactions.deleteLegacy() is deprecated, see https://developer.github.com/v3/reactions/#delete-a-reaction-legacy"
4545
);
46-
}
47-
}
46+
},
47+
},
4848
});
4949
// See https://developer.github.com/v3/reactions/#delete-a-reaction-legacy
5050
await octokit.reactions.deleteLegacy({ reaction_id: 1 });

test/rest-endpoint-methods.test.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ describe("REST API endpoint methods", () => {
1010
{ ok: true },
1111
{
1212
body: {
13-
name: "my-new-repo"
14-
}
13+
name: "my-new-repo",
14+
},
1515
}
1616
);
1717

1818
const MyOctokit = Octokit.plugin(restEndpointMethods);
1919
const octokit = new MyOctokit({
2020
auth: "secret123",
2121
request: {
22-
fetch: mock
23-
}
22+
fetch: mock,
23+
},
2424
});
2525

2626
// See https://developer.github.com/v3/repos/#create
2727
const { data } = await octokit.repos.createForAuthenticatedUser({
28-
name: "my-new-repo"
28+
name: "my-new-repo",
2929
});
3030

3131
expect(data).toStrictEqual({ ok: true });
@@ -38,25 +38,25 @@ describe("REST API endpoint methods", () => {
3838
{
3939
body: {
4040
event_type: "greeting",
41-
client_payload: { name: "Mona" }
42-
}
41+
client_payload: { name: "Mona" },
42+
},
4343
}
4444
);
4545

4646
const MyOctokit = Octokit.plugin(restEndpointMethods);
4747
const octokit = new MyOctokit({
4848
auth: "secret123",
4949
request: {
50-
fetch: mock
51-
}
50+
fetch: mock,
51+
},
5252
});
5353

5454
// See https://developer.github.com/v3/repos/#create
5555
const { data } = await octokit.repos.createDispatchEvent({
5656
owner: "octocat",
5757
repo: "hello-world",
5858
event_type: "greeting",
59-
client_payload: { name: "Mona" }
59+
client_payload: { name: "Mona" },
6060
});
6161

6262
expect(data).toStrictEqual({ ok: true });
@@ -68,40 +68,40 @@ describe("REST API endpoint methods", () => {
6868
{ ok: true },
6969
{
7070
headers: {
71-
"content-type": "text/plain"
71+
"content-type": "text/plain",
7272
},
7373
query: {
7474
name: "test.txt",
75-
label: "test"
75+
label: "test",
7676
},
7777
matcher: (url, { body }) => {
7878
expect(body).toEqual("test 1, 2");
7979
return true;
80-
}
80+
},
8181
}
8282
);
8383

8484
const MyOctokit = Octokit.plugin(restEndpointMethods);
8585
const octokit = new MyOctokit({
8686
auth: "secret123",
8787
request: {
88-
fetch: mock
89-
}
88+
fetch: mock,
89+
},
9090
});
9191

9292
return octokit.repos
9393
.uploadReleaseAsset({
9494
headers: {
95-
"content-type": "text/plain"
95+
"content-type": "text/plain",
9696
},
9797
owner: "octocat",
9898
repo: "hello-world",
9999
release_id: 123,
100100
data: "test 1, 2",
101101
name: "test.txt",
102-
label: "test"
102+
label: "test",
103103
})
104-
.catch(error => {
104+
.catch((error) => {
105105
console.log(error);
106106

107107
throw error;
@@ -113,26 +113,26 @@ describe("REST API endpoint methods", () => {
113113
"https://api.github.com/repos/octocat/hello-world/branches/latest/protection/required_status_checks/contexts",
114114
{ ok: true },
115115
{
116-
body: ["myci1", "myci2"]
116+
body: ["myci1", "myci2"],
117117
}
118118
);
119119

120120
const MyOctokit = Octokit.plugin(restEndpointMethods);
121121
const octokit = new MyOctokit({
122122
auth: "secret123",
123123
request: {
124-
fetch: mock
125-
}
124+
fetch: mock,
125+
},
126126
});
127127

128128
return octokit.repos
129129
.addProtectedBranchRequiredStatusChecksContexts({
130130
owner: "octocat",
131131
repo: "hello-world",
132132
branch: "latest",
133-
contexts: ["myci1", "myci2"]
133+
contexts: ["myci1", "myci2"],
134134
})
135-
.catch(error => {
135+
.catch((error) => {
136136
console.log(error);
137137

138138
throw error;
@@ -148,8 +148,8 @@ describe("REST API endpoint methods", () => {
148148
const octokit = new MyOctokit({
149149
auth: "secret123",
150150
request: {
151-
fetch: mock
152-
}
151+
fetch: mock,
152+
},
153153
});
154154

155155
return octokit.apps.listInstallations();

0 commit comments

Comments
 (0)