Skip to content

Commit

Permalink
packageFilter should have been giving the pkgfile as an argument, fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Feb 17, 2015
1 parent caca9f9 commit 70b71e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module.exports = function resolve (x, opts, cb) {
catch (err) {}

if (opts.packageFilter) {
pkg = opts.packageFilter(pkg, x);
pkg = opts.packageFilter(pkg, pkgfile);
}
if (opts.pathFilter && remainder) {
var newRemainder = opts.pathFilter(pkg, x, remainder);
Expand Down Expand Up @@ -129,7 +129,7 @@ module.exports = function resolve (x, opts, cb) {
catch (err) {}

if (opts.packageFilter) {
pkg = opts.packageFilter(pkg, x);
pkg = opts.packageFilter(pkg, pkgfile);
}

if (pkg.main) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "resolve",
"description": "resolve like require.resolve() on behalf of files asynchronously and synchronously",
"version": "1.1.2",
"version": "1.1.3",
"repository": {
"type": "git",
"url": "git://github.com/substack/node-resolve.git"
Expand Down
4 changes: 2 additions & 2 deletions readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ options are:

* opts.isFile - function to synchronously test whether a file exists

* opts.packageFilter - transform the parsed package.json contents before looking
at the "main" field
* `opts.packageFilter(pkg, pkgfile)` - transform the parsed package.json
* contents before looking at the "main" field

* opts.paths - require.paths array to use if nothing is found on the normal
node_modules recursive walk (probably don't use this)
Expand Down

0 comments on commit 70b71e7

Please sign in to comment.