gulp-edit-xml
Advanced tools
Comparing version 1.1.0 to 2.0.0
24
index.js
var Stream = require('stream'), | ||
xml2js = require('xml2js'), | ||
_ = require('lodash'), | ||
isFunction = require('lodash.isfunction'), | ||
isObject = require('lodash.isobject'), | ||
assign = require("object-assign"), | ||
gutil = require('gulp-util'); | ||
var xmlEdit = function(transform, options){ | ||
if(!_.isFunction(transform)){ | ||
if(!isFunction(transform)){ | ||
transform = function(data){ | ||
@@ -13,3 +15,3 @@ return data; | ||
} | ||
var defaults = { | ||
@@ -25,3 +27,3 @@ parserOptions: {}, | ||
var settings = _.assign(defaults,options); | ||
var settings = assign(defaults, options); | ||
@@ -31,3 +33,3 @@ var stream = new Stream.Transform({ objectMode: true }); | ||
stream._transform = function(file, unused, done){ | ||
var that = this; | ||
@@ -38,3 +40,3 @@ | ||
} | ||
if (file.isStream()) { | ||
@@ -44,3 +46,3 @@ return done(new gutil.PluginError('gulp-xml-edit', 'Streaming not supported')); | ||
var content = file.contents.toString('utf-8'), | ||
@@ -52,3 +54,3 @@ parser = new xml2js.Parser(settings.parserOptions), | ||
var content = transform.call(null, data); | ||
if(!_.isObject(content)){ | ||
if(!isObject(content)){ | ||
done(new gutil.PluginError('gulp-xml-edit', 'transformation does not returns an object')); | ||
@@ -62,6 +64,6 @@ return; | ||
}; | ||
return stream; | ||
} | ||
module.exports = xmlEdit; |
{ | ||
"name": "gulp-edit-xml", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Gulp plugin for editing xml files", | ||
@@ -28,3 +28,5 @@ "main": "index.js", | ||
"gulp-util": "^3.0.4", | ||
"lodash": "^3.8.0", | ||
"lodash.isfunction": "^3.0.6", | ||
"lodash.isobject": "^3.0.2", | ||
"object-assign": "^4.0.1", | ||
"xml2js": "^0.4.8" | ||
@@ -31,0 +33,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9246
101
5
7
+ Addedlodash.isfunction@^3.0.6
+ Addedlodash.isobject@^3.0.2
+ Addedobject-assign@^4.0.1
+ Addedlodash.isfunction@3.0.9(transitive)
+ Addedlodash.isobject@3.0.2(transitive)
+ Addedobject-assign@4.1.1(transitive)
- Removedlodash@^3.8.0
- Removedlodash@3.10.1(transitive)