From 4f4ef10a6bbbcc68ab89d81291faddf57b650928 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 5 Jul 2012 22:30:18 +0200 Subject: o Adding findLinkByRel. --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index bcc6927..f467018 100644 --- a/index.js +++ b/index.js @@ -36,6 +36,11 @@ function fromObject(root) { return f(map); }); }; + root.findLinkByRel = function(rel) { + return _.find(this.collection.links, function(link) { + return rel === link.rel; + }); + } return root; } -- cgit v1.2.3