Skip to content

Commit

Permalink
Fix types for callback argument in get & refresh methods for Cr… (#3127)
Browse files Browse the repository at this point in the history
Co-authored-by: Sameer Goyal <sameeg@amazon.com>
  • Loading branch information
sameergoyal and Sameer Goyal authored Mar 18, 2020
1 parent cd2fe1e commit 31d805a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-Credentials-08f473f2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "Credentials",
"description": "Fix types for callback argument in get & refresh methods for Credentials to accept error optionally"
}
4 changes: 2 additions & 2 deletions lib/credentials.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class Credentials {
*
* @param {get} callback - Called when the instance metadata service responds. When called with no error, the credentials information has been loaded into the object.
*/
get(callback: (err: AWSError) => void): void;
get(callback: (err?: AWSError) => void): void;
/**
* Gets the existing credentials, refreshing them if necessary, and returns
* a promise that will be fulfilled immediately (if no refresh is necessary)
Expand All @@ -38,7 +38,7 @@ export class Credentials {
*
* @param {function} callback - Called when the instance metadata service responds. When called with no error, the credentials information has been loaded into the object.
*/
refresh(callback: (err: AWSError) => void): void;
refresh(callback: (err?: AWSError) => void): void;
/**
* Invokes a credential refresh and returns a promise that will be fulfilled
* when the refresh has completed or rejected when the refresh has failed.
Expand Down

0 comments on commit 31d805a

Please sign in to comment.