data structure for path-addressable resources
npm install path-trie``javascript
var pathTrie = require('path-trie')
var dictionary = {
'a/b/c': 123
}
var trie = pathTrie(dictionary)
// => {
// a: {
// b: {
// c: {
// '@': 123
// }
// }
// }
// }
dictionary = pathTrie.flatten(trie)
// => {
// 'a/b/c': 123
// }
`
from` is an optional path to flatten just a particular subtrie.
$ npm install path-trie
from project root:
$ npm install
$ npm test
- jden