Skip to content

Issues when word contains $ #8

Open
@KamasamaK

Description

@KamasamaK

If I have something like

var triePrefixTree = require("trie-prefix-tree");

var allFunctionNames = triePrefixTree([]);

allFunctionNames.addWord("test$clone");

console.log(allFunctionNames.getPrefix("te"));

I get ["test", "test$clone"] even though I never added test.

Worse, if I do add test as below

var triePrefixTree = require("trie-prefix-tree");

var allFunctionNames = triePrefixTree([]);

allFunctionNames.addWord("test");
allFunctionNames.addWord("test$clone");

console.log(allFunctionNames.getPrefix("te"));

it produces an error: TypeError: Cannot create property 'c' on number '1'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions