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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: cleanup duplicated symbols #4612

Merged
merged 5 commits into from
Mar 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/symbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ const keys = {
kSchemaVisited: Symbol('fastify.schemas.visited'),
// Request
kRequest: Symbol('fastify.Request'),
kRequestValidateFns: Symbol('fastify.request.cache.validateFns'),
kRequestPayloadStream: Symbol('fastify.RequestPayloadStream'),
kRequestAcceptVersion: Symbol('fastify.RequestAcceptVersion'),
kRequestValidateWeakMap: Symbol('fastify.request.cache.validators'),
kRequestValidateWeakMap: Symbol('fastify.request.cache.validateFns'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename it?

Suggested change
kRequestValidateWeakMap: Symbol('fastify.request.cache.validateFns'),
kRequestCacheValidateFns: Symbol('fastify.request.cache.validateFns'),

Of course also need to fix the imports if we rename it.

Copy link
Member Author

@metcoder95 metcoder95 Mar 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one, I rename both ones to be named consistent 馃憤

Check:

// 404
kFourOhFour: Symbol('fastify.404'),
kCanSetNotFoundHandler: Symbol('fastify.canSetNotFoundHandler'),
Expand Down