Socket
Socket
Sign inDemoInstall

gulp-edit-xml

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-edit-xml - npm Package Compare versions

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc