3 function SearchResultsStrategy(options
) {
4 var resultItemStrategy
= options
.resultItemStrategy
;
6 this.preload = function(searchResults
) {
7 var items
= searchResults
12 return resultItemStrategy
.preload(items
);
15 this.map = function(item
) {
16 var results
= item
.results
;
17 if (item
.results
=== undefined || item
.results
=== null) {
18 results
= [].concat(item
);
22 hasMoreResults
: item
.hasMoreResults
,
25 results
: results
.map(function(i
) {
26 return resultItemStrategy
.map(i
);
32 SearchResultsStrategy
.prototype = {
33 name
: 'SearchResultsStrategy'
36 module
.exports
= SearchResultsStrategy
;