browser-pack
Advanced tools
Comparing version 6.0.2 to 6.0.3
26
index.js
@@ -5,2 +5,3 @@ var JSONStream = require('JSONStream'); | ||
var umd = require('umd'); | ||
var Buffer = require('safe-buffer').Buffer; | ||
@@ -48,9 +49,9 @@ var fs = require('fs'); | ||
var pre = umd.prelude(opts.standalone).trim(); | ||
stream.push(new Buffer(pre + 'return ')); | ||
stream.push(Buffer.from(pre + 'return ', 'utf8')); | ||
} | ||
else if (first && stream.hasExports) { | ||
var pre = opts.externalRequireName || 'require'; | ||
stream.push(new Buffer(pre + '=')); | ||
stream.push(Buffer.from(pre + '=', 'utf8')); | ||
} | ||
if (first) stream.push(new Buffer(prelude + '({')); | ||
if (first) stream.push(Buffer.from(prelude + '({', 'utf8')); | ||
@@ -86,3 +87,3 @@ if (row.sourceFile && !row.nomap) { | ||
stream.push(new Buffer(wrappedSource)); | ||
stream.push(Buffer.from(wrappedSource, 'utf8')); | ||
lineno += newlinesIn(wrappedSource); | ||
@@ -99,11 +100,14 @@ | ||
function end () { | ||
if (first) stream.push(new Buffer(prelude + '({')); | ||
if (first) stream.push(Buffer.from(prelude + '({', 'utf8')); | ||
entries = entries.filter(function (x) { return x !== undefined }); | ||
stream.push(new Buffer('},{},' + JSON.stringify(entries) + ')')); | ||
stream.push( | ||
Buffer.from('},{},' + JSON.stringify(entries) + ')', 'utf8') | ||
); | ||
if (opts.standalone && !first) { | ||
stream.push(new Buffer( | ||
stream.push(Buffer.from( | ||
'(' + JSON.stringify(stream.standaloneModule) + ')' | ||
+ umd.postlude(opts.standalone) | ||
+ umd.postlude(opts.standalone), | ||
'utf8' | ||
)); | ||
@@ -119,5 +123,7 @@ } | ||
} | ||
stream.push(new Buffer('\n' + comment + '\n')); | ||
stream.push(Buffer.from('\n' + comment + '\n', 'utf8')); | ||
} | ||
if (!sourcemap && !opts.standalone) stream.push(new Buffer(';\n')); | ||
if (!sourcemap && !opts.standalone) { | ||
stream.push(Buffer.from(';\n', 'utf8')); | ||
} | ||
@@ -124,0 +130,0 @@ stream.push(null); |
{ | ||
"name": "browser-pack", | ||
"version": "6.0.2", | ||
"version": "6.0.3", | ||
"description": "pack node-style source files from a json stream into a browser bundle", | ||
@@ -11,4 +11,5 @@ "main": "index.js", | ||
"JSONStream": "^1.0.3", | ||
"combine-source-map": "~0.7.1", | ||
"combine-source-map": "~0.8.0", | ||
"defined": "^1.0.0", | ||
"safe-buffer": "^5.1.1", | ||
"through2": "^2.0.0", | ||
@@ -18,3 +19,3 @@ "umd": "^3.0.0" | ||
"devDependencies": { | ||
"tap": "^2.2.0", | ||
"tap": "^10.7.2", | ||
"uglify-js": "1.3.5", | ||
@@ -21,0 +22,0 @@ "concat-stream": "~1.5.1", |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
28282
637
6
24
14
+ Addedsafe-buffer@^5.1.1
+ Addedcombine-source-map@0.8.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
- Removedcombine-source-map@0.7.2(transitive)
Updatedcombine-source-map@~0.8.0