-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
/weakness
: Add fuzzy matching
#10316
base: master
Are you sure you want to change the base?
Conversation
server/chat-commands/info.ts
Outdated
const type1 = dex.types.get(targets[0]); | ||
const type2 = dex.types.get(targets[1]); | ||
const type3 = dex.types.get(targets[2]); | ||
let type1: any = dex.types.get(targets[0]); |
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.
let type1: any = dex.types.get(targets[0]); | |
let type1 = dex.types.get(targets[0]); |
This shouldn't need to be any
. Let TypeScript infer it - will allow for better error catching.
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.
Done. I also removed the explicit typing from the species declaration as well. Let me know if you'd prefer it the other way. Thanks for the feedback!
Edit: I'm getting some lint errors and I think that's why I added the any
in the first place (I think in this commit). I'll look into how that's working with the dex functions and try and resolve it soon.
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.
Fixed the linting issues by looping through the species types instead of adding them as an array. Let me know if there's a better way to accomplish that or if there's anything else I can do. Thanks!
/weakness
: Add fuzzy matching
https://www.smogon.com/forums/threads/support-fuzzy-searching-in-weak.3731963/
This is based on work done by @earljoves in #9929 - I expanded it to include type matching