documentation/streams/filter_js.js
2015-07-10 12:43:01 -04:00

19 lines
432 B
JavaScript

'use strict';
var filter = require('through2-filter');
/**
* Node & browserify support requiring JSON files. JSON files can't be documented
* with JSDoc or parsed with espree, so we filter them out before
* they reach documentation's machinery.
*
* @name access
* @public
* @return {stream.Transform}
*/
module.exports = function () {
return filter.obj(function (data) {
return !data.file.match(/\.json$/);
});
};