Comparing version 0.6.4 to 0.6.5
@@ -39,2 +39,10 @@ /*global define FantasyLand inspectf*/ | ||
function isBinary(f){ | ||
return f.length >= 2; | ||
} | ||
function isTernary(f){ | ||
return f.length >= 3; | ||
} | ||
function isPositiveInteger(n){ | ||
@@ -224,15 +232,17 @@ return n === Infinity || (typeof n === 'number' && n > 0 && n % 1 === 0 && n === n); | ||
function check$encase(f){ | ||
if(typeof f !== 'function') error$invalidArgument('Future.encase', 0, 'be a function', f); | ||
if(!isFunction(f)) error$invalidArgument('Future.encase', 0, 'be a function', f); | ||
} | ||
function check$encase2(f){ | ||
if(typeof f !== 'function') error$invalidArgument('Future.encase2', 0, 'be a function', f); | ||
if(!isFunction(f)) error$invalidArgument('Future.encase2', 0, 'be a function', f); | ||
if(!isBinary(f)) error$invalidArgument('Future.encase2', 0, 'take at least two arguments', f); | ||
} | ||
function check$encase3(f){ | ||
if(typeof f !== 'function') error$invalidArgument('Future.encase3', 0, 'be a function', f); | ||
if(!isFunction(f)) error$invalidArgument('Future.encase3', 0, 'be a function', f); | ||
if(!isTernary(f)) error$invalidArgument('Future.encase3', 0, 'take at least three arguments', f); | ||
} | ||
function check$node(f){ | ||
if(typeof f !== 'function') error$invalidArgument('Future.node', 0, 'be a function', f); | ||
if(!isFunction(f)) error$invalidArgument('Future.node', 0, 'be a function', f); | ||
} | ||
@@ -420,2 +430,3 @@ | ||
FutureClass.prototype = Future.prototype = { | ||
'@@type': 'fluture/Future', | ||
_f: null, | ||
@@ -453,2 +464,4 @@ fork: Future$fork, | ||
isFunction, | ||
isBinary, | ||
isTernary, | ||
isPositiveInteger, | ||
@@ -455,0 +468,0 @@ preview, |
{ | ||
"name": "fluture", | ||
"version": "0.6.4", | ||
"version": "0.6.5", | ||
"description": "A mathematically correct alternative to Promises for asynchronous control flow", | ||
@@ -64,5 +64,8 @@ "main": "fluture.js", | ||
"nsp": "^2.2.0", | ||
"pacta": "^0.9.0", | ||
"ramda": "^0.20.1", | ||
"ramda-fantasy": "^0.4.1", | ||
"rimraf": "^2.4.3" | ||
"rimraf": "^2.4.3", | ||
"sanctuary": "^0.9.1" | ||
} | ||
} |
@@ -520,2 +520,7 @@ # Fluture | ||
```js | ||
const m = Future(rej => rej()); | ||
Future.isFuture(m) === (m instanceof Future) === S.is(Future, m); | ||
``` | ||
#### `isForkable :: a -> Boolean` | ||
@@ -522,0 +527,0 @@ |
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
41640
583
580
15