Skip to content

Commit 8b1afc6

Browse files
authored
chore(credential-provider-imds): arrow fn in ImdsCredentials (#1317)
1 parent 85866ff commit 8b1afc6

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.ts

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,17 @@ export interface ImdsCredentials {
77
Expiration: string;
88
}
99

10-
export function isImdsCredentials(arg: any): arg is ImdsCredentials {
11-
return (
12-
Boolean(arg) &&
13-
typeof arg === "object" &&
14-
typeof arg.AccessKeyId === "string" &&
15-
typeof arg.SecretAccessKey === "string" &&
16-
typeof arg.Token === "string" &&
17-
typeof arg.Expiration === "string"
18-
);
19-
}
10+
export const isImdsCredentials = (arg: any): arg is ImdsCredentials =>
11+
Boolean(arg) &&
12+
typeof arg === "object" &&
13+
typeof arg.AccessKeyId === "string" &&
14+
typeof arg.SecretAccessKey === "string" &&
15+
typeof arg.Token === "string" &&
16+
typeof arg.Expiration === "string";
2017

21-
export function fromImdsCredentials(creds: ImdsCredentials): Credentials {
22-
return {
23-
accessKeyId: creds.AccessKeyId,
24-
secretAccessKey: creds.SecretAccessKey,
25-
sessionToken: creds.Token,
26-
expiration: new Date(creds.Expiration)
27-
};
28-
}
18+
export const fromImdsCredentials = (creds: ImdsCredentials): Credentials => ({
19+
accessKeyId: creds.AccessKeyId,
20+
secretAccessKey: creds.SecretAccessKey,
21+
sessionToken: creds.Token,
22+
expiration: new Date(creds.Expiration)
23+
});

0 commit comments

Comments
 (0)