This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adopt new version of 'resolve' dependency
- Loading branch information
1 parent
718d974
commit 7af8d04
Showing
6 changed files
with
36 additions
and
69 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,15 +1,20 @@ | ||
import fs from 'fs'; | ||
import { sync } from 'resolve'; | ||
|
||
export default function follow (x, opts) { | ||
// TODO async version | ||
return new Promise((resolve) => { | ||
resolve(sync(x, opts)); | ||
// TODO own implementation with foreign tests | ||
// TODO async follow | ||
/* | ||
resolve_(x, opts, (error, result) => { | ||
if (error) return reject(error); | ||
resolve(result); | ||
}); | ||
*/ | ||
resolve(sync(x, { | ||
basedir: opts.basedir, | ||
extensions: opts.extensions, | ||
readFileSync: (file) => { | ||
opts.readFile(file); | ||
return fs.readFileSync(file); | ||
}, | ||
packageFilter: (config, base) => { | ||
opts.packageFilter(config, base); | ||
return config; | ||
} | ||
})); | ||
}); | ||
} |
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
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
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