read-package-json
Advanced tools
Comparing version 0.0.9 to 0.0.10
{ | ||
"name": "read-package-json", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)", | ||
@@ -5,0 +5,0 @@ "description": "The thing npm uses to read package.json files with semantics and defaults and validation", |
@@ -203,4 +203,4 @@ // vim: set softtabstop=16 shiftwidth=16: | ||
fs.readFile(gitDesc, 'utf8', function (er, desc) { | ||
desc = desc.trim() | ||
if (!er && desc.trim() !== defDesc) | ||
if (desc) desc = desc.trim() | ||
if (!er && desc !== defDesc) | ||
data.description = desc | ||
@@ -218,3 +218,4 @@ return cb(null, data) | ||
for (var s = 0; d[s].trim().match(/^(#|$)/); s ++); | ||
for (var e = s + 1; d[e].trim(); e ++); | ||
var l = d.length | ||
for (var e = s + 1; e < l && d[e].trim(); e ++); | ||
data.description = d.slice(s, e).join(' ').trim() | ||
@@ -221,0 +222,0 @@ } |
27407
524