MCPcopy Index your code
hub / github.com/apache/pouchdb / pathToTree

Function pathToTree

lib/index.es.js:1010–1024  ·  view source on GitHub ↗
(path$$1, numStemmed)

Source from the content-addressed store, hash-verified

1008// If any should be stemmed from the beginning of the array, that's passed
1009// in as the second argument
1010function pathToTree(path$$1, numStemmed) {
1011 var root;
1012 var leaf;
1013 for (var i = numStemmed, len = path$$1.length; i < len; i++) {
1014 var node = path$$1[i];
1015 var currentLeaf = [node.id, node.opts, []];
1016 if (leaf) {
1017 leaf[2].push(currentLeaf);
1018 leaf = currentLeaf;
1019 } else {
1020 root = leaf = currentLeaf;
1021 }
1022 }
1023 return root;
1024}
1025
1026// compare the IDs of two trees
1027function compareTree(a, b) {

Callers 1

stemFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…