Socket
Socket
Sign inDemoInstall

fluture

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluture - npm Package Compare versions

Comparing version 2.0.1 to 3.0.0

README.md

48

fluture.js

@@ -31,7 +31,7 @@ //// ____ _ _

const FL = {
map: 'map',
bimap: 'bimap',
chain: 'chain',
ap: 'ap',
of: 'of'
map: 'fantasy-land/map',
bimap: 'fantasy-land/bimap',
chain: 'fantasy-land/chain',
ap: 'fantasy-land/ap',
of: 'fantasy-land/of'
};

@@ -88,3 +88,3 @@

? `[Function: ${x.name}]`
: '[Function]'
: /*istanbul ignore next*/ '[Function]' //Only for older JS engines.
: x && typeof x === 'object'

@@ -227,3 +227,4 @@ ? `[Object: ${Object.keys(x).map(String).join(', ')}]`

if(!isFunction(f)) throw new TypeError(
`Future#ap can only be used on Future<Function> but was used on a Future of: ${show(f)}`
'Future#ap expects its first argument to be a Future of a Function'
+ `\n Actual: Future.of(${show(f)})`
);

@@ -323,4 +324,4 @@ }

if(!isFuture(m)) throw new TypeError(
'Future.parallel expects argument 1 to be an array of Futures.'
+ ` The value at position ${i} in the array was not a Future.\n Actual: ${show(m)}`
'Future.parallel expects its second argument to be an array of Futures.'
+ ` The value at position ${i} in the array was not a Future\n Actual: ${show(m)}`
);

@@ -481,3 +482,8 @@ }

const rej = x => ko || (ko = 1, g(x));
const c1 = _this._f(rej, function Future$ap$resThis(f){
const c1 = _this._f(rej, function Future$ap$resThis(x){
if(!ok1) return void (ok2 = 1, _x = x)
check$ap$f(_f);
res(_f(x));
});
const c2 = m._f(rej, function Future$ap$resThat(f){
if(!ok2) return void (ok1 = 1, _f = f);

@@ -487,7 +493,2 @@ check$ap$f(f);

});
const c2 = m._f(rej, function Future$ap$resThat(x){
if(!ok1) return void (ok2 = 1, _x = x)
check$ap$f(_f);
res(_f(x));
});
return function Future$ap$cancel(){ c1(); c2() };

@@ -710,11 +711,2 @@ });

//Creates a dispatcher for a unary method, but takes the object first rather than last.
function createInvertedUnaryDispatcher(method){
return function invertedUnaryDispatch(m, a){
if(arguments.length === 1) return unaryPartial(invertedUnaryDispatch, m);
if(m && typeof m[method] === 'function') return m[method](a);
error$invalidArgument(`Future.${method}`, 0, `have a "${method}" method`, m);
};
}
//Creates a dispatcher for a binary method.

@@ -740,9 +732,9 @@ function createBinaryDispatcher(method){

Future.chain = createUnaryDispatcher('chain');
Future.chain = createUnaryDispatcher(FL.chain);
Future.recur = createUnaryDispatcher('recur');
Future.chainRej = createUnaryDispatcher('chainRej');
Future.map = createUnaryDispatcher('map');
Future.map = createUnaryDispatcher(FL.map);
Future.mapRej = createUnaryDispatcher('mapRej');
Future.bimap = createBinaryDispatcher('bimap');
Future.ap = createInvertedUnaryDispatcher('ap');
Future.bimap = createBinaryDispatcher(FL.bimap);
Future.ap = createUnaryDispatcher(FL.ap);
Future.swap = createNullaryDispatcher('swap');

@@ -749,0 +741,0 @@ Future.fork = createBinaryDispatcher('fork');

{
"name": "fluture",
"version": "2.0.1",
"version": "3.0.0",
"description": "FantasyLand compliant (monadic) alternative to Promises",

@@ -61,2 +61,3 @@ "main": "fluture.js",

"eslint": "^3.0.1",
"fantasy-land": "^1.0.1",
"fun-task": "^1.1.1",

@@ -63,0 +64,0 @@ "istanbul": "^0.4.2",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc