gulp-comments
Advanced tools
Comparing version 1.0.6 to 1.1.0
@@ -5,3 +5,3 @@ var gutil = require('gulp-util'); | ||
var through = require('through2'); | ||
module.exports = function() { | ||
module.exports = function(filter) { | ||
return through.obj(function(file, encoding, callback) { | ||
@@ -13,2 +13,9 @@ if (file.isBuffer()) { | ||
if(comments) { | ||
if (filter) { | ||
for (var i = comments.length - 1; i >= 0; i--) { | ||
if (comments[i].indexOf(filter) >= 0) { | ||
comments.splice(i, 1); | ||
} | ||
} | ||
} | ||
contents = comments.join('\n\n'); | ||
@@ -15,0 +22,0 @@ } |
{ | ||
"name": "gulp-comments", | ||
"version": "1.0.6", | ||
"version": "1.1.0", | ||
"description": "Exports all jsdocs-style comments from either .js or .ts files", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -31,3 +31,2 @@ # gulp-comments | ||
}); | ||
``` | ||
@@ -48,1 +47,10 @@ | ||
``` | ||
### Options | ||
An optional **filter** parameter can be added when calling `comments()`. Any jsdoc block containing this string will be _excluded_ from publishing. Can be useful for creating custom documentation builds. | ||
```js | ||
//... | ||
.pipe(comments('@internal')) | ||
// ... | ||
``` |
3234
26
54