about summary refs log tree commit diff stats
path: root/src/modules
diff options
context:
space:
mode:
authorAlan Pearce2017-06-18 12:32:11 +0200
committerAlan Pearce2017-06-18 12:32:11 +0200
commit75ef26ea24032c7e8a6a5d63e65c70d43c88a938 (patch)
tree940f7c9714228ae97a0d4d3b68b8c89e55dac6e4 /src/modules
parentdb7c9f17bbfe026630448d5f24ed7d42e4d859ad (diff)
downloadhomestead-75ef26ea24032c7e8a6a5d63e65c70d43c88a938.tar.lz
homestead-75ef26ea24032c7e8a6a5d63e65c70d43c88a938.tar.zst
homestead-75ef26ea24032c7e8a6a5d63e65c70d43c88a938.zip
fix(metadata): make return values consistent
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/metadata.js9
1 files changed, 2 insertions, 7 deletions
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 = {