@teleology/fp
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -6,8 +6,10 @@ "use strict"; | ||
}); | ||
exports.pipe = void 0; | ||
exports.pipe = exports.isAsyncFunction = void 0; | ||
const isPromise = v => v && v.then && typeof v.then === 'function'; | ||
const isAsyncFunction = v => v && v.then && typeof v.then === 'function' || v[Symbol.toStringTag] === 'AsyncFunction'; | ||
const pipe = (...fn) => initial => fn.reduce((a, n) => isPromise(n) ? n.then(a) : n(a), initial); | ||
exports.isAsyncFunction = isAsyncFunction; | ||
const pipe = (...fn) => initial => fn.reduce((a, n) => isAsyncFunction(n) ? n.then(a) : n(a), initial); | ||
exports.pipe = pipe; |
{ | ||
"name": "@teleology/fp", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "A small collection of functional programming utils", | ||
@@ -5,0 +5,0 @@ "repository": "git@github.com:icarus-sullivan/teleology-fp.git", |
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
12029
213