From e925f5623c8f3c60b4fee704f93538c24964a6a7 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 29 Jun 2012 23:19:06 +0200 Subject: o Making sure each item as an array of links. --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 583d5ae..c0d0378 100644 --- a/index.js +++ b/index.js @@ -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) { -- cgit v1.2.3