insert-module-globals
Advanced tools
Comparing version 1.1.0 to 1.1.1
48
index.js
@@ -85,32 +85,26 @@ var parseScope = require('lexical-scope'); | ||
for(var name in vars) { | ||
if(~scope.globals.implicit.indexOf(name)) { | ||
var value = vars[name].call(this, row, basedir); | ||
if(!value) | ||
Object.keys(vars).forEach(function (name) { | ||
if (scope.globals.implicit.indexOf(name) >= 0) { | ||
var value = vars[name].call(tr, row, basedir); | ||
if (!value) {} | ||
else if ('object' == typeof value) { | ||
value.deps = value.deps || {}; | ||
if (!resolved[name]) tr.queue(value); | ||
var igName = '__browserify_' + name; | ||
row.deps[igName] = value.id; | ||
resolved[name] = true; | ||
globals[name] = 'require(' | ||
+ JSON.stringify(igName) | ||
+ ')' | ||
+ (value.suffix || '') | ||
; | ||
else if('object' == typeof value) { | ||
value.deps = value.deps || {} | ||
if(!resolved[name]) | ||
this.queue(value); | ||
var igName = '__browserify_'+name | ||
row.deps[igName] = value.id | ||
resolved[name] = true | ||
globals[name] = | ||
'require(' | ||
+ JSON.stringify(igName) | ||
+ ')' | ||
+ (value.suffix || ''); | ||
} | ||
else | ||
globals[name] = value; | ||
else globals[name] = value; | ||
} | ||
} | ||
row.source = closeOver(globals, row.source) | ||
this.queue(row); | ||
}); | ||
row.source = closeOver(globals, row.source); | ||
tr.queue(row); | ||
} | ||
@@ -117,0 +111,0 @@ |
{ | ||
"name": "insert-module-globals", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "insert implicit module globals into a module-deps stream", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
121093
3358