Fix error when parsing empty yml file
This commit is contained in:
parent
864bb1d3c5
commit
391effcfa8
1 changed files with 2 additions and 6 deletions
|
|
@ -42,12 +42,8 @@ const parseMarkdown = data => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const parseYaml = data => {
|
const parseYaml = data => {
|
||||||
try {
|
data = yaml.safeLoad(data, 'utf8') || {}
|
||||||
data = yaml.safeLoad(data, 'utf8')
|
return JSON.stringify(data)
|
||||||
return JSON.stringify(data)
|
|
||||||
} catch (e) {
|
|
||||||
return console.log(e)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getFileContents = filePath => {
|
const getFileContents = filePath => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue