browser-module-sandbox
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -6,3 +6,4 @@ ## Collaborators | ||
<table><tbody><tr><th align="left">maxogden</th><td><a href="https://github.com/maxogden">GitHub/maxogden</a></td></tr> | ||
<tr><th align="left">voronianski</th><td><a href="https://github.com/voronianski">GitHub/voronianski</a></td></tr> | ||
<tr><th align="left">maurizzzio</th><td><a href="https://github.com/maurizzzio">GitHub/maurizzzio</a></td></tr> | ||
</tbody></table> |
36
index.js
@@ -21,3 +21,3 @@ var inherits = require('inherits') | ||
this.iframe = iframe({ container: this.container, scrollingDisabled: true }) | ||
this.iframeStyle = "<style type='text/css'>" + | ||
this.iframeStyle = "<style type='text/css'>" + | ||
"html, body { margin: 0; padding: 0; border: 0; }\n" + | ||
@@ -34,7 +34,7 @@ opts.iframeStyle + | ||
var self = this | ||
var modules = detective(entry) | ||
self.emit('bundleStart') | ||
if (modules.length === 0) return makeIframe() | ||
@@ -56,3 +56,5 @@ | ||
if (cached[module]) { | ||
allBundles += cached[module]['bundle'] | ||
var tokens = module.split('@'); | ||
var bundle = !tokens[0] ? cached[module]['bundle'].replace(encodeURIComponent(tokens[1]), tokens[1]) : cached[module]['bundle'] | ||
allBundles += bundle | ||
packages.push(cached[module]['package']) | ||
@@ -63,3 +65,3 @@ } else { | ||
}) | ||
if (download.length === 0) { | ||
@@ -76,10 +78,16 @@ self.emit('modules', packages) | ||
} | ||
download.map(function(module) { | ||
var tokens = module.split('@') | ||
var name = tokens[0] | ||
var version = tokens[1] | ||
var name, version | ||
if (!tokens[0]) { | ||
name = '@'+encodeURIComponent(tokens[1]) | ||
version = tokens[2] | ||
} else { | ||
name = tokens[0] | ||
version = tokens[1] | ||
} | ||
body.dependencies[name] = version | ||
}) | ||
request({method: "POST", body: JSON.stringify(body), url: self.cdn + '/multi'}, downloadedModules) | ||
@@ -113,3 +121,3 @@ }) | ||
var existing = json[module] | ||
json[module + '@' + existing.package.version] = json[module] | ||
json[decodeURIComponent(module) + '@' + existing.package.version] = json[module] | ||
delete json[module] | ||
@@ -119,3 +127,5 @@ }) | ||
Object.keys(json).forEach(function(module) { | ||
allBundles += json[module]['bundle'] | ||
var tokens = module.split('@'); | ||
var bundle = !tokens[0] ? json[module]['bundle'].replace(encodeURIComponent(tokens[1]), tokens[1]) : json[module]['bundle'] | ||
allBundles += bundle | ||
packages.push(json[module]['package']) | ||
@@ -129,3 +139,3 @@ }) | ||
} | ||
function makeIframe(script) { | ||
@@ -132,0 +142,0 @@ script = (script || '') |
{ | ||
"name": "browser-module-sandbox", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "uses browserify-cdn to run node code in an iframe", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
126
7179
5
1