diff --git a/packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.ts b/packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.ts index f3798c0be29bc..de56ff75a728b 100644 --- a/packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.ts +++ b/packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.ts @@ -7,22 +7,17 @@ export interface ImdsCredentials { Expiration: string; } -export function isImdsCredentials(arg: any): arg is ImdsCredentials { - return ( - Boolean(arg) && - typeof arg === "object" && - typeof arg.AccessKeyId === "string" && - typeof arg.SecretAccessKey === "string" && - typeof arg.Token === "string" && - typeof arg.Expiration === "string" - ); -} +export const isImdsCredentials = (arg: any): arg is ImdsCredentials => + Boolean(arg) && + typeof arg === "object" && + typeof arg.AccessKeyId === "string" && + typeof arg.SecretAccessKey === "string" && + typeof arg.Token === "string" && + typeof arg.Expiration === "string"; -export function fromImdsCredentials(creds: ImdsCredentials): Credentials { - return { - accessKeyId: creds.AccessKeyId, - secretAccessKey: creds.SecretAccessKey, - sessionToken: creds.Token, - expiration: new Date(creds.Expiration) - }; -} +export const fromImdsCredentials = (creds: ImdsCredentials): Credentials => ({ + accessKeyId: creds.AccessKeyId, + secretAccessKey: creds.SecretAccessKey, + sessionToken: creds.Token, + expiration: new Date(creds.Expiration) +});