pipe-functions
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -5,3 +5,3 @@ var pipe = function() { | ||
let exec = v(); | ||
if (exec.then) { | ||
if (exec && exec.then) { | ||
return exec.then(v => f(v)); | ||
@@ -8,0 +8,0 @@ } else { |
@@ -8,3 +8,3 @@ 'use strict'; | ||
let exec = v(); | ||
if (exec.then) { | ||
if (exec && exec.then) { | ||
return exec.then(v => f(v)); | ||
@@ -11,0 +11,0 @@ } else { |
{ | ||
"name": "pipe-functions", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Pipe functions in a Unix-like style. It supports Promises (async) anywhere in the pipeline and every step will be executed sequentially. The return (resolve in case of Promises) of each function will be passed in as an argument to the next one", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/DiegoZoracKy/pipe-functions/", |
@@ -20,2 +20,11 @@ /*globals describe, it*/ | ||
it(`should pass forward 'undefined' values`, function() { | ||
const a = () => new Promise((resolve, reject) => setTimeout(() => resolve(undefined), 1000));; | ||
const b = (x) => x + undefined; | ||
const c = (x) => x + 'C'; | ||
assert(pipe(a, b, c)); | ||
}); | ||
}); | ||
@@ -32,3 +41,12 @@ | ||
it(`should pass forward 'undefined' values`, function() { | ||
const a = () => undefined; | ||
const b = (x) => x + undefined; | ||
const c = (x) => x + 'C'; | ||
assert(pipe(a, b, c)); | ||
}); | ||
}); | ||
}); |
@@ -0,0 +0,0 @@ /*globals describe, it*/ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
9333
95