Skip to content

Commit 29d822a

Browse files
committed
Add shallow option
1 parent fed3871 commit 29d822a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ var splicer = require('stream-splicer'),
3030
* @param {boolean} [options.polyglot=false] parse comments with a regex rather than
3131
* a proper parser. This enables support of non-JavaScript languages but
3232
* reduces documentation's ability to infer structure of code.
33+
* @param {boolean} [options.shallow=false] whether to avoid dependency parsing
34+
* even in JavaScript code. With the polyglot option set, this has no effect.
3335
* @return {Object} stream of output
3436
*/
3537
module.exports = function (indexes, options) {
@@ -43,7 +45,7 @@ module.exports = function (indexes, options) {
4345
shallow(indexes),
4446
polyglot()
4547
] : [
46-
dependency(indexes, options),
48+
(options.shallow ? shallow(indexes) : dependency(indexes, options)),
4749
filterJS(),
4850
parse(),
4951
inferName(),

0 commit comments

Comments
 (0)