Skip to content

Commit

Permalink
Replace R.cond with R.ifElse
Browse files Browse the repository at this point in the history
 SUCH WOW
   MUCH HELPFUL
SO REFACTORED
      VERY READABLE
  • Loading branch information
kinday committed May 5, 2016
1 parent 05492aa commit d4c8ee8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions index.js
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 d4c8ee8

Please sign in to comment.