map-reduce
Advanced tools
+1
-1
@@ -31,3 +31,3 @@ /* | ||
| var finished = false | ||
| var reduced = opts.init | ||
| var reduced = opts.init ||opts.initial | ||
@@ -34,0 +34,0 @@ opts.map = opts.map || exports.identity |
+1
-1
| { | ||
| "name": "map-reduce", | ||
| "description": "async NoSql like map reduce function inside node.", | ||
| "version": "0.1.2", | ||
| "version": "0.2.2", | ||
| "homepage": "https://github.com/dominictarr/map-reduce", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -45,2 +45,21 @@ | ||
| exports ['map default to identity with initial set'] = function (test){ | ||
| mapR({ | ||
| on: [1,2,3], | ||
| initial: [], | ||
| reduce: function (col,value){ | ||
| col.push(value) | ||
| return col | ||
| }, | ||
| done: check | ||
| }) | ||
| function check(err,results){ | ||
| it(results).deepEqual([1,2,3]) | ||
| test.done() | ||
| } | ||
| } | ||
| exports ['reduce defaults to collect'] = function (test){ | ||
@@ -47,0 +66,0 @@ |
8253
4.34%284
5.58%