Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
data structure for path-addressable resources
JavaScript
Branch: master
Failed to load latest commit information.
test initial
.gitignore initial
LICENSE.md initial
README.md update readme
index.js break out generic fns to funderscore module
package.json break out generic fns to funderscore module

README.md

path-trie

data structure for path-addressable resources

usage

  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
  //    }

api

pathTrie: (dictionary: Dictionary<String, Value>) => Trie

pathTrie.flatten: (trie: Trie, from: Array<String> = []) => Dictionary<String, Value>

from is an optional path to flatten just a particular subtrie.

pathTrie.put: (this: Trie, path: Path, val: Value) => Trie

pathTrie.get: (this: Trie, path: Path) => Value?

pathTrie.del: (this: Trie, path: Path) => void

installation

$ npm install path-trie

running the tests

from project root:

$ npm install
$ npm test

contributors

license

MIT. (c) 2013 jden jason@denizac.org. See LICENSE.md

Something went wrong with that request. Please try again.