diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-07-05 22:30:18 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-07-05 22:30:18 +0200 |
commit | 4f4ef10a6bbbcc68ab89d81291faddf57b650928 (patch) | |
tree | 7bf99c450e1077fdd335f8b027cacb94417e3034 | |
parent | c8758323adeecea8271ad950e5e6fabc6b34f2fc (diff) | |
download | collection_json.js-4f4ef10a6bbbcc68ab89d81291faddf57b650928.tar.gz collection_json.js-4f4ef10a6bbbcc68ab89d81291faddf57b650928.tar.bz2 collection_json.js-4f4ef10a6bbbcc68ab89d81291faddf57b650928.tar.xz collection_json.js-4f4ef10a6bbbcc68ab89d81291faddf57b650928.zip |
o Adding findLinkByRel.
-rw-r--r-- | index.js | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; } |