Comparing version 0.0.11 to 0.0.12
{ | ||
"name": "treeize", | ||
"version": "0.0.11", | ||
"description": "Converts tabular row data (as from SQL joins, flat JSON, etc) to deep tree graphs based on simple column naming conventions.", | ||
"version": "0.0.12", | ||
"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.", | ||
"main": "./lib/treeize.js", | ||
@@ -14,7 +14,11 @@ "repository": { | ||
"tree", | ||
"object", | ||
"graph", | ||
"hydration", | ||
"model", | ||
"deep", | ||
"convert", | ||
"expand", | ||
"flat" | ||
"flat", | ||
"ORM" | ||
], | ||
@@ -21,0 +25,0 @@ "author": "K. R. Whitley <contact@krwhitley.com> (http://krwhitley.com/)", |
117
README.md
@@ -203,8 +203,8 @@ treeize | ||
names we can completely transform the data (as you would for another API endpoint, | ||
for example). This time we'll organize the data by directors, as you would for | ||
and endpoint like `/api/directors`. | ||
for example). This time we'll organize the data by actors, as you would for | ||
and endpoint like `/api/actors`. | ||
Notice the feed is left unchanged - only the attribute names have been modified to | ||
define their new target path. In this case, by changing the base node to the directors | ||
name (instead of the movie name), we group everything by director at a high level. | ||
define their new target path. In this case, by changing the base node to the actor | ||
name (instead of the movie name), we group everything by actor at a high level. | ||
@@ -215,63 +215,63 @@ ```js | ||
var moviesDump = [ | ||
{ | ||
"movies:title": "The Prestige", | ||
"name": "Christopher Nolan", | ||
"workedWith:name": "Christian Bale", | ||
"workedWith:as": "Alfred Borden" | ||
}, | ||
{ | ||
"movies:title": "The Prestige", | ||
"name": "Christopher Nolan", | ||
"workedWith:name": "Hugh Jackman", | ||
"workedWith:as": "Robert Angier" | ||
}, | ||
{ | ||
"movies:title": "The Dark Knight Rises", | ||
"name": "Christopher Nolan", | ||
"workedWith:name": "Christian Bale", | ||
"workedWith:as": "Bruce Wayne" | ||
}, | ||
{ | ||
"movies:title": "The Departed", | ||
"name": "Martin Scorsese", | ||
"workedWith:name": "Leonardo DiCaprio", | ||
"workedWith:as": "Billy" | ||
}, | ||
{ | ||
"movies:title": "The Departed", | ||
"name": "Martin Scorsese", | ||
"workedWith:name": "Matt Damon", | ||
"workedWith:as": "Colin Sullivan" | ||
} | ||
]; | ||
{ | ||
"movies:title": "The Prestige", | ||
"movies:director": "Christopher Nolan", | ||
"name": "Christian Bale", | ||
"movies:as": "Alfred Borden" | ||
}, | ||
{ | ||
"movies:title": "The Prestige", | ||
"movies:director": "Christopher Nolan", | ||
"name": "Hugh Jackman", | ||
"movies:as": "Robert Angier" | ||
}, | ||
{ | ||
"movies:title": "The Dark Knight Rises", | ||
"movies:director": "Christopher Nolan", | ||
"name": "Christian Bale", | ||
"movies:as": "Bruce Wayne" | ||
}, | ||
{ | ||
"movies:title": "The Departed", | ||
"movies:director": "Martin Scorsese", | ||
"name": "Leonardo DiCaprio", | ||
"movies:as": "Billy" | ||
}, | ||
{ | ||
"movies:title": "The Departed", | ||
"movies:director": "Martin Scorsese", | ||
"name": "Matt Damon", | ||
"movies:as": "Colin Sullivan" | ||
} | ||
]; | ||
var directors = treeize.grow(movieDump); | ||
var actors = treeize.grow(movieDump); | ||
/* | ||
'directors' now contains the following: | ||
'actors' now contains the following: | ||
[ | ||
{ | ||
"name": "Christopher Nolan", | ||
"workedWith": [ | ||
"name": "Christian Bale", | ||
"movies": [ | ||
{ | ||
"as": "Alfred Borden", | ||
"name": "Christian Bale" | ||
"director": "Christopher Nolan", | ||
"title": "The Prestige" | ||
}, | ||
{ | ||
"as": "Robert Angier", | ||
"name": "Hugh Jackman" | ||
}, | ||
{ | ||
"as": "Bruce Wayne", | ||
"name": "Christian Bale" | ||
"director": "Christopher Nolan", | ||
"title": "The Dark Knight Rises" | ||
} | ||
], | ||
] | ||
}, | ||
{ | ||
"name": "Hugh Jackman", | ||
"movies": [ | ||
{ | ||
"as": "Robert Angier", | ||
"director": "Christopher Nolan", | ||
"title": "The Prestige" | ||
}, | ||
{ | ||
"title": "The Dark Knight Rises" | ||
} | ||
@@ -281,15 +281,17 @@ ] | ||
{ | ||
"name": "Martin Scorsese", | ||
"workedWith": [ | ||
"name": "Leonardo DiCaprio", | ||
"movies": [ | ||
{ | ||
"as": "Billy", | ||
"name": "Leonardo DiCaprio" | ||
}, | ||
{ | ||
"as": "Colin Sullivan", | ||
"name": "Matt Damon" | ||
"director": "Martin Scorsese", | ||
"title": "The Departed" | ||
} | ||
], | ||
] | ||
}, | ||
{ | ||
"name": "Matt Damon", | ||
"movies": [ | ||
{ | ||
"as": "Colin Sullivan", | ||
"director": "Martin Scorsese", | ||
"title": "The Departed" | ||
@@ -300,3 +302,4 @@ } | ||
] | ||
*/ | ||
``` |
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
17895
302