gulp-append-prepend
Advanced tools
Comparing version 1.0.6 to 1.0.7
20
index.js
@@ -13,3 +13,3 @@ const through = require('through2'); | ||
const filesContents = []; | ||
for(i = 0; i < filepaths.length; i++){ | ||
for (let i = 0; i < filepaths.length; i++) { | ||
filesContents.push(read.sync(filepaths[i], 'utf8')); | ||
@@ -29,3 +29,3 @@ } | ||
if (type != "append" && type != "prepend") { | ||
if (type !== "append" && type !== "prepend") { | ||
throw new PluginError(PLUGIN_NAME, 'Missing type !'); | ||
@@ -39,7 +39,7 @@ } | ||
const buffers = []; | ||
for (i = 0; i < texts.length; i++) { | ||
if (type == "prepend") { | ||
buffers.push(new Buffer(texts[i].trim() + separator)); | ||
}else if(type == "append") { | ||
buffers.push(new Buffer(separator + texts[i].trim())); | ||
for (let i = 0; i < texts.length; i++) { | ||
if (type === "prepend") { | ||
buffers.push(Buffer.from(texts[i].trim() + separator)); | ||
} else if (type === "append") { | ||
buffers.push(Buffer.from(separator + texts[i].trim())); | ||
} | ||
@@ -56,9 +56,9 @@ } | ||
const concat = []; | ||
if (type == "append") { | ||
if (type === "append") { | ||
concat.push(file.contents); | ||
} | ||
for(i = 0; i < buffers.length; i++){ | ||
for (let i = 0; i < buffers.length; i++) { | ||
concat.push(buffers[i]); | ||
} | ||
if (type == "prepend") { | ||
if (type === "prepend") { | ||
concat.push(file.contents); | ||
@@ -65,0 +65,0 @@ } |
{ | ||
"name": "gulp-append-prepend", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Simple Gulp plugin to append/prepend.", | ||
@@ -31,4 +31,17 @@ "main": "index.js", | ||
], | ||
"jshintConfig": { | ||
"esversion": 9, | ||
"strict": "implied", | ||
"eqeqeq": true, | ||
"undef": true, | ||
"unused": true, | ||
"mocha": true, | ||
"node": true | ||
}, | ||
"scripts": { | ||
"pretest": "jshint *.js spec", | ||
"test": "mocha spec/*.js" | ||
}, | ||
"engines": { | ||
"node": ">= 0.10.0" | ||
"node": ">=8.15.0" | ||
}, | ||
@@ -39,3 +52,8 @@ "dependencies": { | ||
"plugin-error": "^1.0.1" | ||
}, | ||
"devDependencies": { | ||
"jshint": "^2.10.2", | ||
"mocha": "^6.0.2", | ||
"vinyl": "~2.2.0" | ||
} | ||
} |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
10480
8
168
3
1