immutable-ext
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -6,3 +6,5 @@ const Immutable = require('immutable') | ||
fold : function(empty) { | ||
return this.reduce((acc, x) => acc.concat(x), empty) | ||
return empty != null | ||
? this.reduce((acc, x) => acc.concat(x), empty) | ||
: this.reduce((acc, x) => acc.concat(x)) | ||
}, | ||
@@ -9,0 +11,0 @@ foldMap : function(f, empty) { |
{ | ||
"name": "immutable-ext", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "fantasyland compatible extensions", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -84,2 +84,5 @@ const assert = require("assert") | ||
it('works on semigroups (no empty)', () => | ||
assert.deepEqual(List.of([1,2,3], [4,5,6]).fold(), [1,2,3,4,5,6])) | ||
it('foldMaps the list', () => | ||
@@ -86,0 +89,0 @@ assert.deepEqual(List.of(1,2,3).foldMap(x => Sum(x), Sum.empty), Sum(6))) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
152680
4378