-
Notifications
You must be signed in to change notification settings - Fork 14
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
Issues when word contains $ #8
Comments
This issue has now been resolved in 1.5.1. If you have any questions, please get in touch. |
@lyndseybrowning Thanks! It looks like the my second example does not produce an error anymore and gets the expected result. However, the first example still erroneously shows that I've found that using var triePrefixTree = require("trie-prefix-tree");
var allFunctionNames = triePrefixTree([]);
allFunctionNames.addWord("$test");
allFunctionNames.addWord("$");
console.log(allFunctionNames.getPrefix("te")); Produces an error var triePrefixTree = require("trie-prefix-tree");
var allFunctionNames = triePrefixTree([]);
allFunctionNames.addWord("$test");
allFunctionNames.addWord("$clone");
console.log(allFunctionNames.getPrefix("$te")); Returns an empty array. Should I not use this package if my words contain |
The issue is that the Trie uses the $ key to indicate the end of a word. I'd rather not change that. I think my previous fix can be used to resolve the remaining issues. I'll take a look and get back to you. |
If I have something like
I get
["test", "test$clone"]
even though I never addedtest
.Worse, if I do add
test
as belowit produces an error:
TypeError: Cannot create property 'c' on number '1'
The text was updated successfully, but these errors were encountered: