require-list
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -11,3 +11,4 @@ /** | ||
var esprima = require('esprima'); | ||
var escodegen = require('escodegen'), | ||
esprima = require('esprima'); | ||
@@ -38,3 +39,3 @@ var DYNAMIC_LOADING = 'Dynamic loading'; | ||
} else { | ||
return [ DYNAMIC_LOADING ]; | ||
return [ DYNAMIC_LOADING + '_' + escodegen.generate(est) ]; | ||
} | ||
@@ -72,5 +73,12 @@ } | ||
var childs = findRequire(est); | ||
var i = 0, len = childs.length, child; | ||
var i = 0, len = childs.length, child, dcnt = 0; | ||
for (i; i < len; i++) { | ||
child = childs[i]; | ||
if (child.indexOf(DYNAMIC_LOADING + '_') === 0) { | ||
// dynamic loading | ||
result[DYNAMIC_LOADING + '_' + dcnt] = child.replace(DYNAMIC_LOADING + '_', ''); | ||
dcnt++; | ||
continue; | ||
} | ||
if (/^\w/.test(child)) { | ||
@@ -106,3 +114,4 @@ // core module | ||
if (key === DYNAMIC_LOADING) { | ||
if (key.indexOf(DYNAMIC_LOADING) === 0) { | ||
key = DYNAMIC_LOADING + ' code=> ' + childs[key]; | ||
if (color) { | ||
@@ -109,0 +118,0 @@ str += curr_indent + COLOR.YELLOW + key + COLOR.RESET + '\n'; |
{ | ||
"name": "require-list", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "require tree list", | ||
@@ -33,2 +33,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"escodegen": "^1.6.1", | ||
"esprima": "^1.2.5" | ||
@@ -35,0 +36,0 @@ }, |
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
15401
197
2
+ Addedescodegen@^1.6.1
+ Addeddeep-is@0.1.4(transitive)
+ Addedescodegen@1.14.3(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedestraverse@4.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedfast-levenshtein@2.0.6(transitive)
+ Addedlevn@0.3.0(transitive)
+ Addedoptionator@0.8.3(transitive)
+ Addedprelude-ls@1.1.2(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedtype-check@0.3.2(transitive)
+ Addedword-wrap@1.2.5(transitive)