gulp-data
Advanced tools
Comparing version 1.1.2 to 1.2.0
44
index.js
@@ -46,37 +46,17 @@ var extend = require('util-extend'); | ||
// Do nothing if no contents | ||
if (file.isNull()) { | ||
this.push(file); | ||
return callback(); | ||
} | ||
var res = null; | ||
if (typeof data === 'function') { | ||
try { | ||
res = data(file, handle); | ||
if (data.length <= 1) { | ||
local(res); | ||
} | ||
if (file.isStream()) { | ||
// http://nodejs.org/api/stream.html | ||
// http://nodejs.org/api/child_process.html | ||
// https://github.com/dominictarr/event-stream | ||
// accepting streams is optional | ||
this.emit('error', new gutil.PluginError('gulp-data', 'Stream content is not supported')); | ||
return callback(); | ||
} catch(e) { | ||
handle(e); | ||
} | ||
return; | ||
} | ||
// check if file.contents is a `Buffer` | ||
if (file.isBuffer()) { | ||
var res = null; | ||
if (typeof data === 'function') { | ||
try { | ||
res = data(file, handle); | ||
if (data.length <= 1) { | ||
return local(res); | ||
} | ||
} catch(e) { | ||
return handle(e); | ||
} | ||
} | ||
else { | ||
local(data); | ||
} | ||
} | ||
local(data); | ||
} | ||
@@ -83,0 +63,0 @@ |
{ | ||
"name": "gulp-data", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "Generate a data object from a variety of sources: json, front-matter, databases, promises, anything... and set it to the file object for other plugins to consume.", | ||
@@ -23,7 +23,9 @@ "keywords": [ | ||
], | ||
"repository": { | ||
"url": "https://github.com/colynb/gulp-data.git" | ||
}, | ||
"repository": "colynb/gulp-data", | ||
"files": [ | ||
"index.js" | ||
], | ||
"scripts": { | ||
"test": "istanbul test _mocha --report html -- test/*.js --reporter spec" | ||
"pretest": "jshint *.js test/*.js", | ||
"test": "istanbul test _mocha --report html -- test/*.js" | ||
}, | ||
@@ -37,8 +39,9 @@ "dependencies": { | ||
"coveralls": "*", | ||
"event-stream": "*", | ||
"istanbul": "*", | ||
"jshint": "^2.6.0", | ||
"mocha": "*", | ||
"mocha-lcov-reporter": "*", | ||
"q": "^1.0.1", | ||
"should": "^2.1.1" | ||
"should": "^4.6.1", | ||
"vinyl": "^0.4.6" | ||
}, | ||
@@ -45,0 +48,0 @@ "engines": { |
# [gulp](https://github.com/wearefractal/gulp)-data | ||
[![Build Status](https://travis-ci.org/colynb/gulp-data.png?branch=master)](https://travis-ci.org/colynb/gulp-data) | ||
[![Dependencies](https://david-dm.org/colynb/gulp-data.png)](https://david-dm.org/colynb/gulp-data) | ||
[![Build Status](https://travis-ci.org/colynb/gulp-data.svg?branch=master)](https://travis-ci.org/colynb/gulp-data) | ||
[![Dependencies](https://david-dm.org/colynb/gulp-data.svg)](https://david-dm.org/colynb/gulp-data) | ||
[![NPM](https://nodei.co/npm/gulp-data.png?stars&downloads)](https://npmjs.org/package/gulp-data) | ||
[![NPM](https://nodei.co/npm/gulp-data.svg?stars&downloads)](https://www.npmjs.com/package/gulp-data) | ||
@@ -157,7 +157,1 @@ [Learn more about gulp.js, the streaming build system](http://gulpjs.com) | ||
[MIT License](http://en.wikipedia.org/wiki/MIT_License) | ||
[npm-url]: https://npmjs.org/package/gulp-data | ||
[npm-image]: https://badge.fury.io/js/gulp-data.png | ||
[travis-url]: http://travis-ci.org/colynb/gulp-data | ||
[travis-image]: https://secure.travis-ci.org/colynb/gulp-data.png?branch=master |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
7944
8
3
54
157
1