Comparing version 2.0.1 to 2.0.2
@@ -61,2 +61,6 @@ var util = require('util'); | ||
Treeize.prototype.getSeedData = function() { | ||
return this.data.seed; | ||
}; | ||
Treeize.prototype.getStats = function() { | ||
@@ -220,2 +224,3 @@ return this.stats; | ||
data.forEach(function(row) { | ||
this.data.seed.push(row); | ||
var trails = {}; // LUT for trails (find parent of new node in trails path) | ||
@@ -222,0 +227,0 @@ var trail = root = this.data.tree; // OPTIMIZATION: do we need to reset this trail for each row? |
{ | ||
"name": "treeize", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Converts tabular row data (as from SQL joins, flat JSON, etc) to deep object graphs based on simple column naming conventions - without the use of an ORM or models.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/treeize.js", |
@@ -129,2 +129,3 @@ # Treeize.js | ||
- [`getData()`](#getData) - gets current tree data | ||
- [`getSeedData()`](#getSeedData) - gets original, flat data | ||
@@ -263,2 +264,26 @@ ##### * misc/internal methods | ||
### .getSeedData()<a name="getSeedData" /> | ||
Returns original, flat data. | ||
```js | ||
var tree = new Treeize(); | ||
tree.grow([ | ||
{ 'foo': 'bar', 'logs:a': 1 }, | ||
{ 'foo': 'bar', 'logs:a': 2 }, | ||
{ 'foo': 'baz', 'logs:a': 3 } | ||
]); | ||
console.log(tree.getSeedData()); | ||
/* | ||
[ | ||
{ 'foo': 'bar', 'logs:a': 1 }, | ||
{ 'foo': 'bar', 'logs:a': 2 }, | ||
{ 'foo': 'baz', 'logs:a': 3 } | ||
] | ||
*/ | ||
``` | ||
### .getStats()<a name="getStats" /> | ||
@@ -265,0 +290,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5902056
866
686