@@ -63,2 +63,5 @@ "use strict"; | ||
| return x == null ? Left() : Right(x); | ||
| }; | ||
| var fromTruth = exports.fromTruth = function fromTruth(x) { | ||
| return x ? Left(x) : Right(x); | ||
| }; |
+12
-2
@@ -1,2 +0,2 @@ | ||
| "use strict"; | ||
| 'use strict'; | ||
@@ -6,3 +6,6 @@ Object.defineProperty(exports, "__esModule", { | ||
| }); | ||
| exports.safeProp = exports.prop = exports.compose = exports.curry = undefined; | ||
| var _Either = require('../Either'); | ||
| function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
@@ -35,2 +38,9 @@ | ||
| }; | ||
| }; | ||
| }; | ||
| var prop = exports.prop = curry(function (prop, obj) { | ||
| return obj[prop]; | ||
| }); | ||
| var safeProp = exports.safeProp = curry(function (p, obj) { | ||
| return compose(_Either.fromNullable, prop(p))(obj); | ||
| }); |
+8
-5
@@ -18,7 +18,10 @@ "use strict"; | ||
| Object.defineProperty(exports, "Either", { | ||
| enumerable: true, | ||
| get: function get() { | ||
| return _interopRequireDefault(_Either).default; | ||
| } | ||
| Object.keys(_Either).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function get() { | ||
| return _Either[key]; | ||
| } | ||
| }); | ||
| }); | ||
@@ -25,0 +28,0 @@ |
+1
-1
| { | ||
| "name": "fp-small", | ||
| "version": "1.0.1", | ||
| "version": "1.1.0", | ||
| "description": "A small functional programming library", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
10432
4.13%255
5.81%0
-100%