browserify-banner
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -1,11 +0,11 @@ | ||
'use strict'; | ||
"use strict"; | ||
const _ = require('lodash'); | ||
const fs = require('fs'); | ||
const ono = require('ono'); | ||
const path = require('path'); | ||
const moment = require('moment'); | ||
const through = require('through2'); | ||
const convertSourcemap = require('convert-source-map'); | ||
const offsetSourcemap = require('offset-sourcemap-lines'); | ||
const _ = require("lodash"); | ||
const fs = require("fs"); | ||
const ono = require("ono"); | ||
const path = require("path"); | ||
const moment = require("moment"); | ||
const through = require("through2"); | ||
const convertSourcemap = require("convert-source-map"); | ||
const offsetSourcemap = require("offset-sourcemap-lines"); | ||
@@ -23,3 +23,3 @@ module.exports = browserifyBanner; | ||
if (typeof browserify === 'string') { | ||
if (typeof browserify === "string") { | ||
// browserify-banner was loaded as a transform, not a plug-in. | ||
@@ -30,6 +30,6 @@ // So return a stream that does nothing. | ||
browserify.on('package', setPackageOption); | ||
browserify.on('file', setFileOption); | ||
browserify.on('bundle', wrapBundle); | ||
browserify.on('reset', wrapBundle); | ||
browserify.on("package", setPackageOption); | ||
browserify.on("file", setFileOption); | ||
browserify.on("bundle", wrapBundle); | ||
browserify.on("reset", wrapBundle); | ||
@@ -55,3 +55,3 @@ /** | ||
if (!options.file) { | ||
options.file = path.join(path.dirname(file), 'banner.txt'); | ||
options.file = path.join(path.dirname(file), "banner.txt"); | ||
} | ||
@@ -64,3 +64,3 @@ } | ||
function wrapBundle () { | ||
let wrap = browserify.pipeline.get('wrap'); | ||
let wrap = browserify.pipeline.get("wrap"); | ||
let bannerAlreadyAdded = false; | ||
@@ -100,7 +100,7 @@ let banner; | ||
// Get the sourcemap, once it exists | ||
let conv = convertSourcemap.fromSource(chunk.toString('utf8')); | ||
let conv = convertSourcemap.fromSource(chunk.toString("utf8")); | ||
if (conv) { | ||
// Offset the sourcemap by the number of lines in the banner | ||
let offsetMap = offsetSourcemap(conv.toObject(), countLines(banner)); | ||
this.push(new Buffer('\n' + convertSourcemap.fromObject(offsetMap).toComment() + '\n')); | ||
this.push(new Buffer("\n" + convertSourcemap.fromObject(offsetMap).toComment() + "\n")); | ||
pushed = true; | ||
@@ -133,3 +133,3 @@ } | ||
if (!options.banner) { | ||
if (typeof options.pkg === 'string') { | ||
if (typeof options.pkg === "string") { | ||
// Read the package.json file | ||
@@ -150,3 +150,3 @@ options.pkg = readJSON(options.pkg); | ||
if (!/^\s*(\/\/|\/\*)/.test(options.banner)) { | ||
options.banner = '/*!\n * ' + options.banner.trim().replace(/\n/g, '\n * ') + '\n */\n'; | ||
options.banner = "/*!\n * " + options.banner.trim().replace(/\n/g, "\n * ") + "\n */\n"; | ||
} | ||
@@ -166,3 +166,3 @@ } | ||
function readJSON (filePath) { | ||
let json = fs.readFileSync(filePath, 'utf8'); | ||
let json = fs.readFileSync(filePath, "utf8"); | ||
@@ -186,3 +186,3 @@ try { | ||
try { | ||
return fs.readFileSync(startingPath, 'utf8'); | ||
return fs.readFileSync(startingPath, "utf8"); | ||
} | ||
@@ -189,0 +189,0 @@ catch (e) { |
{ | ||
"name": "browserify-banner", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "Add a comment (and/or code) to the top of your Browserify bundle", | ||
@@ -21,3 +21,3 @@ "keywords": [ | ||
"license": "MIT", | ||
"homepage": "https://github.com/JS-DevTools/browserify-banner", | ||
"homepage": "https://jsdevtools.org/browserify-banner", | ||
"repository": { | ||
@@ -32,3 +32,3 @@ "type": "git", | ||
"scripts": { | ||
"lint": "eslint lib test/fixtures test/specs --fix", | ||
"lint": "eslint lib test/fixtures test/specs", | ||
"test": "mocha && npm run lint", | ||
@@ -43,6 +43,6 @@ "coverage": "nyc --reporter=text --reporter=lcov mocha", | ||
"chai": "^4.2.0", | ||
"codacy-coverage": "^3.1.0", | ||
"codacy-coverage": "^3.3.0", | ||
"coveralls": "^3.0.2", | ||
"eslint": "^5.6.1", | ||
"eslint-config-modular": "^4.2.1", | ||
"eslint": "^5.9.0", | ||
"eslint-config-modular": "^5.0.0", | ||
"exorcist": "^1.0.1", | ||
@@ -52,6 +52,6 @@ "mkdirp": "^0.5.1", | ||
"npm-check": "^5.9.0", | ||
"nyc": "^13.0.1", | ||
"nyc": "^13.1.0", | ||
"touch": "^3.1.0", | ||
"uglifyify": "^5.0.1", | ||
"version-bump-prompt": "^4.2.0" | ||
"version-bump-prompt": "^4.2.1" | ||
}, | ||
@@ -63,4 +63,4 @@ "dependencies": { | ||
"offset-sourcemap-lines": "^1.0.1", | ||
"ono": "^4.0.9", | ||
"through2": "^2.0.3" | ||
"ono": "^4.0.10", | ||
"through2": "^3.0.0" | ||
}, | ||
@@ -67,0 +67,0 @@ "engines": { |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
15742
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedthrough2@3.0.2(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedisarray@1.0.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedthrough2@2.0.5(transitive)
- Removedxtend@4.0.2(transitive)
Updatedono@^4.0.10
Updatedthrough2@^3.0.0