-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
feat(variables): added arrayFuzzySearch
variable (#3002)
#3003
base: v5
Are you sure you want to change the base?
Conversation
Introduced an `arrayFuzzySearch` replace variable
Checked out `package-lock.json` from Upstream as it should not be effected by my changes
Thanks Oceanity, I love this! If only everything in computer sciences were fuzzier by default, we'd all be better off! Two (non-blocking) ideas:
To future reviewer(s) of this: |
Added support for Fuse.js's `threshold` property as well as the ability to supply a default value if no matches are found crowbartools#3003 (comment)
Added in da8c8fa |
Made copy in description a bit more formal
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.
Thanks for working on this @Oceanity!
I agree with @phroggster that it would be worth updating fuse.js to latest. We are already on 7.x.x and from the change log I am not seeing any notable breaking changes. If you could bump fuses version in this PR, that would be great. Then we can get this merged in 👌🏻
Upgraded Fuse.js dependency to have access to new functionality
Utilized the ignoreDiacritics param in Fuse.js 7.1.0 to allow the replace variable to ignore diacritics
Updated Fuse.js to latest (d31ad98) and added param to ignore Diacritics (8ee0ba2)! |
Description of the Change
Introduced an
arrayFuzzySearch
variable that allows a user to find the closest match in an array for a provided searchApplicable Issues
#3002
Testing
Tested all 3 provided examples to ensure they work as expected, and also tested passing in a simple custom variable array and an array from an HTTP Request response
Screenshots
n/a