Comparing version 1.0.0 to 1.1.0
@@ -14,3 +14,3 @@ var fs = require('fs'); | ||
"browser" : true, | ||
"boss" : false, | ||
"boss" : true, | ||
"curly" : true, | ||
@@ -17,0 +17,0 @@ "debug" : false, |
@@ -7,4 +7,6 @@ var _ = require('lodash'); | ||
delimiter: ':', | ||
debug: false, | ||
benchmark: false, | ||
collections: { | ||
auto: true | ||
auto: true, | ||
} | ||
@@ -24,5 +26,11 @@ }; | ||
this.grow = function(flatData, config) { | ||
var t1; | ||
var localOptions = _.extend(this.options(), config || {}); | ||
var translated = []; | ||
// optional benchmark | ||
if (globalOptions.benchmark) { | ||
t1 = (new Date()).getTime(); | ||
} | ||
if (!flatData || !flatData.length) { return flatData; } | ||
@@ -107,2 +115,8 @@ | ||
// output benchmark if enabled | ||
if (globalOptions.benchmark) { | ||
console.log('[treeize]: translated ' + flatData.length + ' rows in ' + ((new Date()).getTime() - t1) + 'ms'); | ||
console.log('[treeize]: stringify size ' + Math.floor(JSON.stringify(flatData).length / 1024) + 'KB => ' + Math.floor(JSON.stringify(translated).length / 1024) + 'KB'); | ||
} | ||
return translated; | ||
@@ -109,0 +123,0 @@ } |
{ | ||
"name": "treeize", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"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", |
@@ -46,2 +46,3 @@ treeize | ||
delimiter: ':', // Path delimiter, as in "foo:bar:baz" | ||
benchmark: false, // Set to true to log benchmark & compression stats | ||
collections: { | ||
@@ -48,0 +49,0 @@ auto: true // Defaults to pluralized detection for collections. |
@@ -149,4 +149,6 @@ var treeize = require('../lib/treeize'); | ||
delimiter: ':', | ||
debug: false, | ||
benchmark: false, | ||
collections: { | ||
auto: true | ||
auto: true, | ||
} | ||
@@ -153,0 +155,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
22256
336
372