import TrieSearch from ".";
type MyType = {
key1?: string;
key2?: string;
};
const trie: TrieSearch<MyType> = new TrieSearch<MyType>("key1");
const keyValue1 = "valué with space";
const item1 = { key1: keyValue1 };
trie.add(item1);
console.dir(trie.root, { depth: null });
{
v: {
a: {
l: {
u: {
'é': { value: [ { key1: 'valué with space' } ] },
e: { value: [ { key1: 'valué with space' } ] }
}
}
}
},
w: {
i: {
t: {
h: {
value: [
{ key1: 'valué with space' }, // this should not be duplicated
{ key1: 'valué with space' }
]
}
}
}
},
s: {
p: {
a: {
c: {
e: {
value: [
{ key1: 'valué with space' }, // neither should this
{ key1: 'valué with space' }
]
}
}
}
}
}
}
Steps To Reproduce
Actual Result