Skip to content

Commit

Permalink
remove ensureExecutable. Replace with maybeExec.
Browse files Browse the repository at this point in the history
  • Loading branch information
joelnet committed Oct 16, 2018
1 parent 7de4e91 commit 55249cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
8 changes: 0 additions & 8 deletions _internal/ensureExecutable.js

This file was deleted.

7 changes: 3 additions & 4 deletions core/pipe.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

const ensureExecutable = require('../_internal/ensureExecutable')
const maybeExec = require('../_internal/maybeExec')

const pipe = (funcs = []) => value => funcs.reduce(
(acc, func) => acc.then(ensureExecutable(func)),
Promise.resolve(value),
(acc, func) => acc.then(maybeExec(func)),
Promise.resolve(value)
)

module.exports = pipe
7 changes: 3 additions & 4 deletions core/pipeR.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

const ensureExecutable = require('../_internal/ensureExecutable')
const maybeExec = require('../_internal/maybeExec')

const pipeR = func => value => func(pipeR(func)).reduce(
(acc, x) => acc.then(ensureExecutable(x)),
Promise.resolve(value),
(acc, func) => acc.then(maybeExec(func)),
Promise.resolve(value)
)

module.exports = pipeR

0 comments on commit 55249cc

Please sign in to comment.