map-reduce
Advanced tools
Comparing version 0.1.2 to 0.2.2
@@ -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 |
{ | ||
"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
11
284