[Pkg-javascript-commits] [node-module-deps] 74/444: document opts.filter
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 15 09:47:44 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-module-deps.
commit 208c61a05771c3eb08cc2182b91a6318edcb9e53
Author: James Halliday <mail at substack.net>
Date: Thu Apr 25 11:50:17 2013 -0700
document opts.filter
---
index.js | 2 +-
readme.markdown | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/index.js b/index.js
index aa11623..3efdbf3 100644
--- a/index.js
+++ b/index.js
@@ -111,7 +111,7 @@ module.exports = function (mains, opts) {
var resolved = {};
deps.forEach(function (id) {
- if(opts.filter && !opts.filter(id)) {
+ if (opts.filter && !opts.filter(id)) {
resolved[id] = false;
if (--p === 0) done();
return;
diff --git a/readme.markdown b/readme.markdown
index d7b978b..69d6148 100644
--- a/readme.markdown
+++ b/readme.markdown
@@ -71,6 +71,10 @@ package.json at all.
`opts.resolve(id, parent, cb)` signature that
[browser-resolve](https://github.com/shtylman/node-browser-resolve) has
+* opts.filter - a function (id) to skip resolution of some module `id` strings.
+If defined, `opts.filter(id)` should return truthy for all the ids to include
+and falsey for all the ids to skip.
+
* opts.packageFilter - transform the parsed package.json contents before using
the values. `opts.packageFilter(pkg)` should return the new `pkg` object to use.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git
More information about the Pkg-javascript-commits
mailing list