browserify
Advanced tools
Comparing version 16.5.2 to 17.0.0
13
index.js
@@ -21,3 +21,3 @@ var path = require('path'); | ||
var sanitize = require('htmlescape').sanitize; | ||
var shasum = require('shasum'); | ||
var shasum = require('shasum-object'); | ||
@@ -666,3 +666,12 @@ var bresolve = require('browser-resolve'); | ||
if (/\.json$/.test(row.file)) { | ||
row.source = 'module.exports=' + sanitize(row.source); | ||
var sanitizedString = sanitize(row.source); | ||
try { | ||
// check json validity | ||
JSON.parse(sanitizedString); | ||
row.source = 'module.exports=' + sanitizedString; | ||
} catch (err) { | ||
err.message = 'While parsing ' + (row.file || row.id) + ': ' + err.message | ||
this.emit('error', err); | ||
return; | ||
} | ||
} | ||
@@ -669,0 +678,0 @@ this.push(row); |
{ | ||
"name": "browserify", | ||
"version": "16.5.2", | ||
"version": "17.0.0", | ||
"description": "browser-side require() the node way", | ||
@@ -38,6 +38,6 @@ "main": "index.js", | ||
"defined": "^1.0.0", | ||
"deps-sort": "^2.0.0", | ||
"deps-sort": "^2.0.1", | ||
"domain-browser": "^1.2.0", | ||
"duplexer2": "~0.1.2", | ||
"events": "^2.0.0", | ||
"events": "^3.0.0", | ||
"glob": "^7.1.0", | ||
@@ -48,3 +48,3 @@ "has": "^1.0.0", | ||
"inherits": "~2.0.1", | ||
"insert-module-globals": "^7.0.0", | ||
"insert-module-globals": "^7.2.1", | ||
"labeled-stream-splicer": "^2.0.0", | ||
@@ -55,3 +55,3 @@ "mkdirp-classic": "^0.5.2", | ||
"parents": "^1.0.1", | ||
"path-browserify": "~0.0.0", | ||
"path-browserify": "^1.0.0", | ||
"process": "~0.11.0", | ||
@@ -63,5 +63,5 @@ "punycode": "^1.3.2", | ||
"resolve": "^1.1.4", | ||
"shasum": "^1.0.0", | ||
"shasum-object": "^1.0.0", | ||
"shell-quote": "^1.6.1", | ||
"stream-browserify": "^2.0.0", | ||
"stream-browserify": "^3.0.0", | ||
"stream-http": "^3.0.0", | ||
@@ -75,3 +75,3 @@ "string_decoder": "^1.1.1", | ||
"url": "~0.11.0", | ||
"util": "~0.10.1", | ||
"util": "~0.12.0", | ||
"vm-browserify": "^1.0.0", | ||
@@ -78,0 +78,0 @@ "xtend": "^4.0.0" |
@@ -7,2 +7,3 @@ var test = require('tap').test; | ||
var concat = require('concat-stream'); | ||
var semver = require('semver'); | ||
@@ -17,3 +18,4 @@ var temp = require('temp'); | ||
test('crypto --insertGlobals', function (t) { | ||
// `crypto-browserify` no longer works in node.js <4 | ||
test('crypto --insertGlobals', { skip: semver.lt(process.version, 'v4.0.0') }, function (t) { | ||
t.plan(2); | ||
@@ -20,0 +22,0 @@ |
@@ -7,2 +7,3 @@ var test = require('tap').test; | ||
var concat = require('concat-stream'); | ||
var semver = require('semver'); | ||
@@ -17,3 +18,4 @@ var temp = require('temp'); | ||
test('*-browserify libs from node_modules/', function (t) { | ||
// `crypto-browserify` no longer works in node.js <4 | ||
test('*-browserify libs from node_modules/', { skip: semver.lt(process.version, 'v4.0.0') }, function (t) { | ||
t.plan(2); | ||
@@ -20,0 +22,0 @@ |
@@ -49,1 +49,10 @@ var browserify = require('../'); | ||
}); | ||
test('invalid json', function (t) { | ||
var b = browserify(); | ||
t.plan(1); | ||
b.add(__dirname + '/json/invalid.js'); | ||
b.bundle(function (err, src) { | ||
t.ok(err); | ||
}); | ||
}); |
@@ -15,3 +15,3 @@ /** | ||
// Main app bundle has the main app code and the shared libarary code | ||
// Main app bundle has the main app code and the shared library code | ||
var app = browserify([__dirname + '/reverse_multi_bundle/app.js']) | ||
@@ -18,0 +18,0 @@ .external(__dirname + '/reverse_multi_bundle/lazy.js') |
var Seq = require('seq'); | ||
var browserify = require('../'); | ||
var test = require('tap').test; | ||
var shasum = require('shasum'); | ||
var shasum = require('shasum-object'); | ||
@@ -6,0 +6,0 @@ test('syntax cache - valid', function (t) { |
var browserify = require('../'); | ||
var test = require('tap').test; | ||
var util = require('util'); | ||
var xtend = require('xtend'); | ||
var vm = require('vm'); | ||
@@ -49,3 +50,4 @@ | ||
b.bundle(function (err, src) { | ||
var c = { Object : { prototype: Object.prototype } }; | ||
var c = xtend({}, Object); | ||
delete c.create; | ||
vm.runInNewContext(src, c); | ||
@@ -52,0 +54,0 @@ var EE = c.require('events').EventEmitter; |
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
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
361336
431
5712
+ Addedshasum-object@^1.0.0
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedis-arguments@1.1.1(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-generator-function@1.0.10(transitive)
+ Addedis-typed-array@1.1.13(transitive)
+ Addedpath-browserify@1.0.1(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedstream-browserify@3.0.0(transitive)
+ Addedutil@0.12.5(transitive)
+ Addedwhich-typed-array@1.1.15(transitive)
- Removedshasum@^1.0.0
- Removedevents@2.1.0(transitive)
- Removedjson-stable-stringify@0.0.1(transitive)
- Removedjsonify@0.0.1(transitive)
- Removedpath-browserify@0.0.1(transitive)
- Removedshasum@1.0.2(transitive)
- Removedstream-browserify@2.0.2(transitive)
Updateddeps-sort@^2.0.1
Updatedevents@^3.0.0
Updatedinsert-module-globals@^7.2.1
Updatedpath-browserify@^1.0.0
Updatedstream-browserify@^3.0.0
Updatedutil@~0.12.0