directory-tree-md
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -56,5 +56,7 @@ 'use strict'; | ||
if (options && options.mdconf) { | ||
const content = FS.readFileSync(path).toString().match(/^<!--(\s?[^>]*)-->/); | ||
if (content) { | ||
item.mdconf = strToObj(content[1]); | ||
const contentStr = FS.readFileSync(path).toString(); | ||
if (contentStr) { | ||
const contentMatch = contentStr.match(/^<!--(\s?[^>]*)-->/); | ||
item.mdconf = contentMatch ? strToObj(contentMatch[1]) : {}; | ||
item.isEmpty = contentMatch ? !String.prototype.trim.call(contentStr.replace(contentMatch[0], '')) : true; | ||
} | ||
@@ -61,0 +63,0 @@ } |
{ | ||
"name": "directory-tree-md", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Convert a directory tree to a JS object.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -53,2 +53,3 @@ # node-directory-tree-md | ||
}, | ||
"isEmpty": true, | ||
"size": 23, | ||
@@ -55,0 +56,0 @@ "extension": ".md", |
7530
73
202