browser-pack
Advanced tools
Comparing version
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
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
28282
0.87%637
0.95%6
20%24
-4%14
7.69%+ Added
+ Added
+ Added
- Removed
Updated