Skip to content

Commit

Permalink
Fix creation of json spec file
Browse files Browse the repository at this point in the history
  • Loading branch information
JaapRood committed Aug 8, 2022
1 parent 0f99edf commit 24c21d1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ export type ParseResult =

function parse(filePath: string, fileContents: string): ParseResult {
if (isJson(filePath)) {
return { success: true, value: JSON.parse(fileContents) };
return {
success: true,
value: (fileContents && JSON.parse(fileContents)) || {},
};
} else if (isYaml(filePath)) {
return { success: true, value: loadYaml(fileContents) };
} else {
Expand Down

0 comments on commit 24c21d1

Please sign in to comment.