Comparing version 2.2.0 to 2.2.1
@@ -1,10 +0,9 @@ | ||
// @flow | ||
/*:: | ||
/* @flow */ | ||
/* :: | ||
type Action = string; | ||
type IO = { io: Action, then: Function } | ||
type Actions = { [Action]: (IO) => any } | ||
type IO = { io: Action, then?: Function }; | ||
type Actions = { [Action]: (any) => any }; | ||
*/ | ||
function isIO(value /*: mixed */) { | ||
function isIO(value) { | ||
return Boolean( | ||
@@ -29,4 +28,5 @@ value != null && | ||
// Work out what's next | ||
if (isIO(nextIO)) { | ||
return run_(actions, nextIO); | ||
return run_(actions, nextIO); // Process more IO | ||
} else { | ||
@@ -41,12 +41,16 @@ return nextIO; // final result | ||
module.exports.run = function run(actions /*:Actions*/, io /*:IO*/) { | ||
if (!actions) { | ||
throw new Error('ioperator.run called without actions'); | ||
} | ||
module.exports = { | ||
run: function(actions /*:Actions*/, io /*:IO*/) /*:Promise<*>*/ { | ||
if (!actions) { | ||
throw new Error('ioperator.run called without actions'); | ||
} | ||
if (!isIO(io)) { | ||
throw new Error('ioperator.run called with a non io-action: ' + io); | ||
if (!isIO(io)) { | ||
throw new Error( | ||
'ioperator.run called with a non io-action: ' + String(io) | ||
); | ||
} | ||
return run_(actions, io); | ||
} | ||
return run_(actions, io); | ||
}; |
{ | ||
"name": "ioperator", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"main": "ioperator.js", | ||
@@ -10,3 +10,3 @@ "repository": "git@github.com:pokle/ioperator.git", | ||
"clean": "rm -rf coverage", | ||
"test": "jest --coverage", | ||
"test": "flow check && jest --coverage", | ||
"bench": "node tests/bench.js" | ||
@@ -17,2 +17,3 @@ }, | ||
"benchmark": "2.1.4", | ||
"flow-bin": "0.58.0", | ||
"jest-cli": "21.2.1" | ||
@@ -19,0 +20,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
4127
47
3