From 75ef26ea24032c7e8a6a5d63e65c70d43c88a938 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 18 Jun 2017 12:32:11 +0200 Subject: fix(metadata): make return values consistent --- src/modules/metadata.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/modules/metadata.js b/src/modules/metadata.js index 9f24d8e..f35031d 100644 --- a/src/modules/metadata.js +++ b/src/modules/metadata.js @@ -24,20 +24,15 @@ function canonicaliseMetadata (meta) { return meta } -function readFileMetadata (filename) { - return canonicaliseMetadata(matter.read(filename, options)) -} - function getFileMetadata (filename) { - const result = readFileMetadata(filename) - return result && result.data + return canonicaliseMetadata(matter.read(filename, options)) } function getFolderMetadata (folder) { return fs .readdirSync(folder) .map(f => path.resolve(folder, f)) - .map(readFileMetadata) + .map(getFileMetadata) } module.exports = { -- cgit 1.4.1