jade-dependency
Advanced tools
Comparing version 1.0.0 to 1.0.1
44
index.js
@@ -18,22 +18,30 @@ 'use strict'; | ||
var file_content = fs.readFileSync(abs_path, 'utf8'); | ||
var parser = new JadeParser(file_content, abs_path, options); | ||
var file_content = ''; | ||
try { | ||
file_content = fs.readFileSync(abs_path, 'utf8'); | ||
} catch(e) { | ||
// File is probably gone | ||
} | ||
var dependencies = []; | ||
// Modified from: JadeParser.parse() | ||
while (true) { | ||
var type = parser.peek().type; | ||
if (type === 'eos') { | ||
break; | ||
} | ||
if (file_content) { | ||
var parser = new JadeParser(file_content, abs_path, options); | ||
// Modified from: JadeParser.parse() | ||
while (true) { | ||
var type = parser.peek().type; | ||
if (type === 'eos') { | ||
break; | ||
} | ||
// Modified from: JadeParser.parseExpr() | ||
switch (type) { | ||
case 'extends': | ||
case 'include': | ||
// Modified from: JadeParser.parseInclude() | ||
var dependency = path.resolve(parser.resolvePath(parser.expect(type).val.trim(), type)); | ||
dependencies.push(dependency); | ||
break; | ||
default: | ||
parser.advance(); | ||
// Modified from: JadeParser.parseExpr() | ||
switch (type) { | ||
case 'extends': | ||
case 'include': | ||
// Modified from: JadeParser.parseInclude() | ||
var dependency = path.resolve(parser.resolvePath(parser.expect(type).val.trim(), type)); | ||
dependencies.push(dependency); | ||
break; | ||
default: | ||
parser.advance(); | ||
} | ||
} | ||
@@ -40,0 +48,0 @@ } |
{ | ||
"name": "jade-dependency", | ||
"description": "Find jade file dependents (include and extend).", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"homepage": "https://github.com/lishid/jade-dependency", | ||
@@ -6,0 +6,0 @@ "repository": "git://github.com/lishid/jade-dependency.git", |
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
6645
78