Skip to content

Commit fd74b58

Browse files
committed
added reduce method
1 parent ebac2c0 commit fd74b58

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cobalt.fragment.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ cobalt.fragment = function(text, annotations) {
164164
map: function( f ) {
165165
return new cobaltAnnotationList( this.list.map(f) );
166166
},
167+
/**
168+
*
169+
*/
170+
reduce: function( previousValue, f ) {
171+
return this.list.reduce( previousValue, f);
172+
},
167173
/**
168174
* Search through all annotations and return a new annotation list with
169175
* only those annotations that match the selector.

0 commit comments

Comments
 (0)