Evan Shortiss
Evan Shortiss
That looks solid to me. Should provide plenty of context for introspection. Nice work! 👍
@dougwilson @hacksparrow just to be clear, by bubbling you mean bubble to an upper "app" (express) instance? So for submounted apps, the event will bubble to the parent app and...
@flying-sheep you need to address the type checker error, e.g change `validatePromise (username, password, req, reply)` to `validatePromise (username: string, password: string, req: FastifyRequest, reply: FastifyReply)`
Wow, sorry, you're right. Looks like an odd [TS behaviour](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#implicit-any-error-raised-for-un-annotated-callback-arguments-with-no-matching-overload-arguments). Not sure what's best here. Perhaps export two definitions? ```ts export type FastifyBasicAuthValidateFnCallback = (username: string, password: string, req: FastifyRequest,...
Yeah, seems like it's necessary to explicitly define the type for the Promise-based approach. Exporting those `FastifyBasicAuthValidateFnPromise` and `FastifyBasicAuthValidateFnCallback` seems like an alright compromise perhaps? At least it will provide...
This isn't specific to `FastifyPlugin` AFAICT. Just a quirk of TS. Take a look at this [playground example](https://www.typescriptlang.org/play?#code/C4TwDgpgBAwghgGwQIzgYwNZQLxQBQQBOhA-AFxQCixA9oQJQ4B8UAbjQJYAmAsAFD9QkKAAkaNDAFUAzhwB2Ac3hJUmHPgCu0ohWnBC8hQBooYONOm79hk2mQVlKdBkbYW7boPDQxEmYYAFQhoAWw5tdTwtHSg9A0UTMwsreIVXFiDQ8IgAHg8uAB9qYMImfi9hAIQNBXkAQUIFaXUAb34oDrZEbjhgDho5XwwKIf9FR1UMAtHZRUyw7X4AX3K+ADMNOTQ+gdNq2rl8OEbLKCqa+pPGNoE+FduAegeoIQhm+TWiQgguKDQ6b7bBAgACE-H+cj0f2Q5wO6jA+3keBunS6CB6O0G4mGmm0hES5mkJi4Awg6SgKNRnRJcggeHo7U69yWDMez1ezTQcDkchowCgyGgHy+PzBfAhULAwQWEFh8nhiLkyMZHVY3S4vX6WIkFCieIJFnJlKpUG+wA0hEO82yADpvtIaAhWHTWajmaz+E8oGMFFAIAAPBEcNAcfmvKBrOgvAAW0C5KmcXQMcGQCGgiAQNAA7pyARBtlBhd8thBwQMoWr0RrgHQRtifdaIrg9UQDdIjSrTRBzZaztLbfbHc76csy5D+VKsto5XJKIH0SH+bgERclca0RitUMKJWMXRlvQgA) that exhibits the same behaviour. A TypeScript wizard can possibly figure out...
@maybesmurf this could be supported, but the reason I didn't do so is because I wanted to allow a developer to choose the validation order. Supporting a `validator.multiple()` is possible,...
@danielbrauer could you you `npm install [email protected] -S` and see if that helps? Looks like a change to the express typings caused this and it's not related specifically to any...
@danielbrauer in case you're curious what the patch is - check [this commit](https://github.com/evanshortiss/express-joi-validation/commit/3df3d462dade0efaabf300240f9928f26a415d00). I tested locally using your example and by changing my `node_modules/express-joi-validation/express-joi-validation.d.ts` to have that change
@danielbrauer can you update to Joi v16 and Joi types v16? AFAICT that'll resolve the new issue, i.e `npm i @hapi/joi@16 @types/hapi__joi@16 -S`