Skip to content

Commit

Permalink
fix(types): update username and password type definition (#806)
Browse files Browse the repository at this point in the history
  • Loading branch information
adipascu authored Jan 13, 2023
1 parent 8b14873 commit 7c2a2b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/types/aedes.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ broker = new Aedes({
callback(new Error('connection error'), false)
}
},
authenticate: (client: Client, username: Readonly<string>, password: Readonly<Buffer>, callback) => {
authenticate: (client: Client, username: Readonly<string | undefined>, password: Readonly<Buffer | undefined>, callback) => {
if (username === 'test' && password === Buffer.from('test') && client.version === 4) {
callback(null, true)
} else {
Expand Down
4 changes: 2 additions & 2 deletions types/instance.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ declare module 'aedes' {

type AuthenticateHandler = (
client: Client,
username: Readonly<string>,
password: Readonly<Buffer>,
username: Readonly<string | undefined>,
password: Readonly<Buffer | undefined>,
done: (error: AuthenticateError | null, success: boolean | null) => void
) => void

Expand Down

0 comments on commit 7c2a2b9

Please sign in to comment.