Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5cf835a
commit fc4c6ac
Showing
3 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,35 @@ | ||
export default function esDepsResolved(input) { | ||
return Promise.resolve(input); | ||
import R from 'ramda'; | ||
import esDeps from 'es-deps'; | ||
import p from 'path'; | ||
import binded from 'binded'; | ||
import Promise from 'pinkie-promise'; | ||
import resolveCwd from 'resolve-cwd'; | ||
import _resolveFrom from 'resolve-from'; | ||
|
||
const { resolve } = binded(Promise); | ||
|
||
const { log: _log } = binded(console); | ||
const log = R.tap(_log); | ||
|
||
const resolveFrom = R.curry(_resolveFrom); | ||
|
||
// const | ||
const id = R.identity; | ||
|
||
function esDepsResolved(filename) { | ||
return R.pipeP(resolve, | ||
resolveCwd, | ||
esDeps, | ||
R.map(R.pipe( | ||
R.of, | ||
R.ap([id, resolveFrom(p.dirname(resolveCwd(filename)))]), | ||
R.zipObj(['requested', 'resolved']), | ||
R.merge({ from: resolveCwd(filename) }), | ||
log, | ||
id | ||
)), | ||
id | ||
)(filename); | ||
} | ||
|
||
export default esDepsResolved; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters