trie data stricture with wildcards
npm install wild-triesmall and flexible trie with wildcards
``javascript
import WildTrie from 'wild-trie'
var trie = new WildTrie({
//path: any function that returns an array of keys of any type
path: function(pointer) { return pointer.split('/').slice(1) },
//wild: any value to use as wildcard Key (equality is based on the "SameValueZero" algorithm)
wild: '*'
})
var _a = trie.add('/*/a'),
a_ = trie.add('/a/*'),
aa = trie.add('/a/a')
console.assert(trie.size, 3)
console.assert(trie.get('/a/a'), aa)
console.assert(trie.get('/z/a'), _a)
console.assert(trie.get('/a/z'), a_)
console.assert(trie.get('/z/z'), undefined)
console.assert(trie.all('/a/a'), [aa, a_, _a])
console.assert(trie.all('/z/a'), [a_])
console.assert(trie.all('/z/z'), [])
`
* available in CommonJS and ES6 modules
* CJS: var WildTrie = require('wild-trie')import WildTrie from 'wild-trie'
* ES modules: Map
* wildcard and key equality based on the "SameValueZero" algorithms (same as )
new WildTrie(options=defaults): TrieArray
* .path: - the chain of keys to the leafArray
* .keys: - the list of child keysnumber
* .size: - the number of entries in the trieany
* .add(path:): Trieany
* .get(path:): Trieany
* .all(path:): Arrayany
* .del(path:): booleanundefined`
* .clear():