-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat(types): router option types #6282
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Because typing is used in two files, maybe we can export a type from fastify.d.ts: export interface RouterOptions {
allowUnsafeRegex?: boolean,
buildPrettyMeta?: (route: { [k: string]: unknown, store: { [k: string]: unknown } }) => object,
caseSensitive?: boolean,
constraints?: {
[name: string]: ConstraintStrategy<FindMyWayVersion<RawServer>, unknown>,
},
defaultRoute?: (req: FastifyRequest, res: FastifyReply) => void,
ignoreDuplicateSlashes?: boolean,
ignoreTrailingSlash?: boolean,
maxParamLength?: number,
onBadUrl?: (path: string, req: FastifyRequest, res: FastifyReply) => void,
querystringParser?: (str: string) => { [key: string]: unknown },
useSemicolonDelimiter?: boolean,
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
The typescript tests are failing |
Looks like typescript tests are failing because Should we update fastify to use |
@dancastillo can you fix the problem in a separate PR if you're free? 🙏 |
@gurgunday of course here is PR #6286 |
This comment was marked as off-topic.
This comment was marked as off-topic.
@mcollina @gurgunday the typescripts tests are now passing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Is it possible to release a new version including this change? This should have been included in v5.5.0, as for now we get this deprecation message:
And we can't do nothing about it, as TypeScript will get mad. Thanks! |
Checklist
types for #5985
npm run test && npm run benchmark --if-present
and the Code of conduct