diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-06-29 23:19:06 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-06-29 23:19:06 +0200 |
commit | e925f5623c8f3c60b4fee704f93538c24964a6a7 (patch) | |
tree | 29ea9a647e739c0513a61eeefa546c751875949c | |
parent | 7a244dd2af1375af9197188aa84f13bc215b4065 (diff) | |
download | collection_json.js-e925f5623c8f3c60b4fee704f93538c24964a6a7.tar.gz collection_json.js-e925f5623c8f3c60b4fee704f93538c24964a6a7.tar.bz2 collection_json.js-e925f5623c8f3c60b4fee704f93538c24964a6a7.tar.xz collection_json.js-e925f5623c8f3c60b4fee704f93538c24964a6a7.zip |
o Making sure each item as an array of links.
-rw-r--r-- | index.js | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -13,6 +13,10 @@ function fromObject(root) { c.queries = _.isArray(c.queries) ? c.queries : []; c.templates = _.isArray(c.templates) ? c.templates : []; + _.each(c.items, function(item) { + item.links = _.isArray(item.links) ? item.links : []; + }); + // TODO: make un-enumerable root.mapItemData = function(f) { return _.map(this.collection.items, function(item) { |