Skip to content

Commit

Permalink
Merge pull request #10 from iamstarkov/refactor-cond
Browse files Browse the repository at this point in the history
Replace `R.cond` with `R.ifElse`
  • Loading branch information
iamstarkov committed May 5, 2016
2 parents 05492aa + d4c8ee8 commit 267ac7c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ const isJSON = R.pipe(R.split('.'), R.last, R.equals('json'));
const emptyDeps = R.always([]);

// deps :: String -> Boolean
const deps = R.pipeP(toPromise, _resolved, R.cond([
[R.isNil, emptyDeps],
[isBuiltinModule, emptyDeps],
[isJSON, emptyDeps],
[R.T, esDepsResolved],
]));
const deps = R.pipeP(toPromise, _resolved, R.ifElse(
R.anyPass([R.isNil, isBuiltinModule, isJSON]),
emptyDeps,
esDepsResolved
));

// esDepsDeep :: Array[String] -> Object -> Array[Object]
function esDepsDeep(files, options = {}) {
Expand Down

0 comments on commit 267ac7c

Please sign in to comment.