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

Fix types for callback argument in get & refresh methods for Credentials to accept error optionally #3127

Merged
merged 1 commit into from
Mar 18, 2020
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
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