Skip to content

Commit

Permalink
The callback may be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
axelrindle committed Mar 1, 2022
1 parent 68b47c2 commit 7726c0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ type CallbackFunction = (error?: Error, update?: ReleaseDescriptor | TagDescript

type RestHandlerFunction = (res: IncomingMessage) => void

export default function check(options: CheckOptions, callback: CallbackFunction): null | Promise<ReleaseDescriptor | TagDescriptor>
export default function check(options: CheckOptions, callback?: CallbackFunction): null | Promise<ReleaseDescriptor | TagDescriptor>
export = check
4 changes: 2 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const check = require('./check')
* The exported checking function.
*
* @param {CheckOptions} options The options for the version check.
* @param {CallbackFunction} callback An optional callback to pass the result to.
* Can be omitted to return a Promise.
* @param {CallbackFunction|undefined} callback An optional callback to pass the result to.
* Can be omitted to return a Promise.
* @return null or a Promise.
*/
module.exports = (options, callback) => {
Expand Down

0 comments on commit 7726c0b

Please sign in to comment.