Skip to content

Commit 06ff692

Browse files
committed
chore: prettier --write **/*.{ts,js,md,json}
1 parent 022cdd2 commit 06ff692

File tree

17 files changed

+28
-38
lines changed

17 files changed

+28
-38
lines changed

packages/credential-provider-ini/src/index.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jest.mock("fs", () => {
3333
callback(new Error("ENOENT: no such file or directory"));
3434
}
3535

36-
fs.__addMatcher = function(toMatch: string, toReturn: string): void {
36+
fs.__addMatcher = function (toMatch: string, toReturn: string): void {
3737
matchers.set(toMatch, toReturn);
3838
};
39-
fs.__clearMatchers = function(): void {
39+
fs.__clearMatchers = function (): void {
4040
matchers.clear();
4141
};
4242
fs.readFile = readFile;

packages/credential-provider-process/src/index.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jest.mock("fs", () => {
3232
callback(new Error("ENOENT: no such file or directory"));
3333
}
3434

35-
fs.__addFsMatcher = function(toMatch: string, toReturn: string): void {
35+
fs.__addFsMatcher = function (toMatch: string, toReturn: string): void {
3636
matchers.set(toMatch, toReturn);
3737
};
38-
fs.__clearFsMatchers = function(): void {
38+
fs.__clearFsMatchers = function (): void {
3939
matchers.clear();
4040
};
4141
fs.readFile = readFile;
@@ -86,13 +86,13 @@ jest.mock("child_process", () => {
8686
callback(new Error("ENOENT: no such file or directory"));
8787
}
8888

89-
child_process.__addChildProcessMatcher = function(
89+
child_process.__addChildProcessMatcher = function (
9090
command: string,
9191
json: string
9292
): void {
9393
matchers.set(command, json);
9494
};
95-
child_process.__clearChildProcessMatchers = function(): void {
95+
child_process.__clearChildProcessMatchers = function (): void {
9696
matchers.clear();
9797
};
9898

packages/credential-provider-process/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ async function resolveProcessCredentials(
120120
}
121121

122122
function execPromise(command: string) {
123-
return new Promise(function(resolve, reject) {
123+
return new Promise(function (resolve, reject) {
124124
exec(command, (error, stdout, stderr) => {
125125
if (error) {
126126
reject(error);

packages/eventstream-serde-browser/src/getChunkedStream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function getChunkedStream(
66
let currentMessagePendingLength = 0;
77
let currentMessage: Uint8Array | null = null;
88
let messageLengthBuffer: Uint8Array | null = null;
9-
const allocateMessage = function(size: number) {
9+
const allocateMessage = function (size: number) {
1010
if (typeof size !== "number") {
1111
throw new Error(
1212
"Attempted to allocate an event message where size was not a number: " +

packages/eventstream-serde-node/src/EventMessageChunkerStream.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe("EventMessageChunkerStream", () => {
2323
chunkerStream.on("data", msg => {
2424
messages.push(msg);
2525
});
26-
chunkerStream.on("end", function() {
26+
chunkerStream.on("end", function () {
2727
expect(messages.length).toBe(3);
2828
done();
2929
});
@@ -46,7 +46,7 @@ describe("EventMessageChunkerStream", () => {
4646
chunkerStream.on("data", msg => {
4747
messages.push(msg);
4848
});
49-
chunkerStream.on("end", function() {
49+
chunkerStream.on("end", function () {
5050
expect(messages.length).toBe(4);
5151
for (let i = 0; i < mockMessages.length; i++) {
5252
expect(messages[i].toString("base64")).toEqual(
@@ -75,7 +75,7 @@ describe("EventMessageChunkerStream", () => {
7575
chunkerStream.on("data", msg => {
7676
messages.push(msg);
7777
});
78-
chunkerStream.on("end", function() {
78+
chunkerStream.on("end", function () {
7979
expect(messages.length).toBe(3);
8080
done();
8181
});
@@ -97,7 +97,7 @@ describe("EventMessageChunkerStream", () => {
9797
chunkerStream.on("data", msg => {
9898
messages.push(msg);
9999
});
100-
chunkerStream.on("end", function() {
100+
chunkerStream.on("end", function () {
101101
expect(messages.length).toBe(3);
102102
done();
103103
});
@@ -119,7 +119,7 @@ describe("EventMessageChunkerStream", () => {
119119
chunkerStream.on("data", msg => {
120120
messages.push(msg);
121121
});
122-
chunkerStream.on("end", function() {
122+
chunkerStream.on("end", function () {
123123
expect(messages.length).toBe(3);
124124
done();
125125
});

packages/eventstream-serde-node/src/fixtures/MockEventMessageSource.fixture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class MockEventMessageSource extends Readable {
2222
const self = this;
2323
if (this.readCount === this.data.length) {
2424
if (this.throwError) {
25-
process.nextTick(function() {
25+
process.nextTick(function () {
2626
self.emit("error", new Error("Throwing an error!"));
2727
});
2828
return;

packages/hash-stream-node/src/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,8 @@ export const fileStreamHasher: StreamHasher<Readable> = function fileStreamHashe
2828
reject(err);
2929
});
3030
hashCalculator.on("error", reject);
31-
hashCalculator.on("finish", function(this: HashCalculator) {
32-
hash
33-
.digest()
34-
.then(resolve)
35-
.catch(reject);
31+
hashCalculator.on("finish", function (this: HashCalculator) {
32+
hash.digest().then(resolve).catch(reject);
3633
});
3734
});
3835
};

packages/middleware-sdk-route53/src/change-resource-record-sets.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe("changeResourceRecordSetsMiddleware", () => {
88
const next = jest.fn();
99
const input = {
1010
ChangeBatch: {
11-
Changes: (function*() {
11+
Changes: (function* () {
1212
for (let i = 0; i < 6; i++) {
1313
yield {
1414
ResourceRecordSet: {

packages/middleware-signing/src/middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function awsAuthMiddleware<Input extends object, Output extends object>(
2323
return (
2424
next: FinalizeHandler<Input, Output>
2525
): FinalizeHandler<Input, Output> =>
26-
async function(
26+
async function (
2727
args: FinalizeHandlerArguments<Input>
2828
): Promise<FinalizeHandlerOutput<Output>> {
2929
if (!HttpRequest.isInstance(args.request)) return next(args);

packages/node-http-handler/src/server.mock.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { HttpResponse } from "@aws-sdk/types";
1818
const fixturesDir = join(__dirname, "..", "fixtures");
1919

2020
export function createResponseFunction(httpResp: HttpResponse) {
21-
return function(request: IncomingMessage, response: ServerResponse) {
21+
return function (request: IncomingMessage, response: ServerResponse) {
2222
response.statusCode = httpResp.statusCode;
2323
for (let name of Object.keys(httpResp.headers)) {
2424
let values = httpResp.headers[name];
@@ -33,7 +33,7 @@ export function createResponseFunction(httpResp: HttpResponse) {
3333
}
3434

3535
export function createContinueResponseFunction(httpResp: HttpResponse) {
36-
return function(request: IncomingMessage, response: ServerResponse) {
36+
return function (request: IncomingMessage, response: ServerResponse) {
3737
response.writeContinue();
3838
setTimeout(() => {
3939
createResponseFunction(httpResp)(request, response);

packages/node-http-handler/src/set-connection-timeout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function setConnectionTimeout(
1010
return;
1111
}
1212

13-
request.on("socket", function(this: ClientRequest, socket: Socket) {
13+
request.on("socket", function (this: ClientRequest, socket: Socket) {
1414
if (socket.connecting) {
1515
// Throw a connecting timeout error unless a connection is made within x time
1616
let timeoutId = setTimeout(() => {

packages/node-http-handler/src/set-socket-timeout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export function setSocketTimeout(
55
reject: (err: Error) => void,
66
timeoutInMs: number = 0
77
) {
8-
request.setTimeout(timeoutInMs, function(this: ClientRequest) {
8+
request.setTimeout(timeoutInMs, function (this: ClientRequest) {
99
// abort the request to destroy it
1010
this.abort();
1111
const timeoutError = new Error(

packages/shared-ini-file-loader/src/index.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jest.mock("fs", () => {
3232
callback(new Error("ENOENT: no such file or directory"));
3333
}
3434

35-
fs.__addMatcher = function(toMatch: string, toReturn: string): void {
35+
fs.__addMatcher = function (toMatch: string, toReturn: string): void {
3636
matchers.set(toMatch, toReturn);
3737
};
38-
fs.__clearMatchers = function(): void {
38+
fs.__clearMatchers = function (): void {
3939
matchers.clear();
4040
};
4141
fs.readFile = readFile;

packages/shared-ini-file-loader/src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ export function loadSharedConfigFiles(
5151
.then(parseIni)
5252
.then(normalizeConfigFile)
5353
.catch(swallowError),
54-
slurpFile(filepath)
55-
.then(parseIni)
56-
.catch(swallowError)
54+
slurpFile(filepath).then(parseIni).catch(swallowError)
5755
]).then((parsedFiles: Array<ParsedIniData>) => {
5856
const [configFile, credentialsFile] = parsedFiles;
5957
return {

packages/signature-v4/src/SignatureV4.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,5 @@ function formatDate(now: DateInput): { longDate: string; shortDate: string } {
383383
}
384384

385385
function getCanonicalHeaderList(headers: object): string {
386-
return Object.keys(headers)
387-
.sort()
388-
.join(";");
386+
return Object.keys(headers).sort().join(";");
389387
}

packages/stream-collector-node/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const streamCollector: StreamCollector = (
1414
reject(err);
1515
});
1616
collector.on("error", reject);
17-
collector.on("finish", function(this: Collector) {
17+
collector.on("finish", function (this: Collector) {
1818
const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
1919
resolve(bytes);
2020
});

packages/util-uri-escape/src/escape-uri.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,5 @@ export function escapeUri(uri: string): string {
88
}
99

1010
function hexEncode(c: string) {
11-
return `%${c
12-
.charCodeAt(0)
13-
.toString(16)
14-
.toUpperCase()}`;
11+
return `%${c.charCodeAt(0).toString(16).toUpperCase()}`;
1512
}

0 commit comments

Comments
 (0)