Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency prettier to v3 #347

Merged
merged 3 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"esbuild": "^0.18.0",
"glob": "^10.2.6",
"jest": "^29.0.0",
"prettier": "2.8.8",
"prettier": "3.0.0",
"ts-jest": "^29.0.0",
"typescript": "^5.0.0"
},
Expand Down
12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
constructor(
message: string,
statusCode: number,
options: RequestErrorOptions
options: RequestErrorOptions,
) {
super(message);

Expand All @@ -75,10 +75,10 @@
const requestCopy = Object.assign({}, options.request);
if (options.request.headers.authorization) {
requestCopy.headers = Object.assign({}, options.request.headers, {
authorization: options.request.headers.authorization.replace(
/ .*$/,
" [REDACTED]"
" [REDACTED]",
),

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on
library input
may run slow on strings starting with ' ' and with many repetitions of ' '.
});
}

Expand All @@ -97,8 +97,8 @@
get() {
logOnceCode(
new Deprecation(
"[@octokit/request-error] `error.code` is deprecated, use `error.status`."
)
"[@octokit/request-error] `error.code` is deprecated, use `error.status`.",
),
);
return statusCode;
},
Expand All @@ -107,8 +107,8 @@
get() {
logOnceHeaders(
new Deprecation(
"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
)
"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.",
),
);
return headers || {};
},
Expand Down
12 changes: 6 additions & 6 deletions test/request-error.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe("RequestError", () => {
const error = new RequestError("test", 123, options);

expect(error.request.url).toEqual(
"https://api.github.com/?client_id=123&client_secret=[REDACTED]"
"https://api.github.com/?client_id=123&client_secret=[REDACTED]",
);
});

Expand All @@ -84,7 +84,7 @@ describe("RequestError", () => {
const error = new RequestError("test", 123, options);

expect(error.request.url).toEqual(
"https://api.github.com/?client_id=123&client_secret=[REDACTED]"
"https://api.github.com/?client_id=123&client_secret=[REDACTED]",
);
});

Expand All @@ -100,7 +100,7 @@ describe("RequestError", () => {
const error = new RequestError("test", 123, options);

expect(error.request.url).toEqual(
"https://api.github.com/?access_token=[REDACTED]"
"https://api.github.com/?access_token=[REDACTED]",
);
});

Expand Down Expand Up @@ -141,15 +141,15 @@ describe("RequestError", () => {
test("deprecates .headers", () => {
global.console.warn = jest.fn();
expect(new RequestError("test", 123, mockOptions).headers).toStrictEqual(
{}
{},
);
expect(
new RequestError("test", 404, { ...mockOptions, headers: { foo: "bar" } })
.headers
.headers,
).toStrictEqual({ foo: "bar" });
expect(
new RequestError("test", 404, { ...mockOptions, headers: undefined })
.headers
.headers,
).toStrictEqual({});
expect(console.warn).toHaveBeenCalledTimes(1);
});
Expand Down