Skip to content

Commit

Permalink
fix: fix JSON parse issue
Browse files Browse the repository at this point in the history
  • Loading branch information
wswebcreation committed Sep 7, 2019
1 parent 5413550 commit ed13e60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/generate-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ function generateReport(options) {
step.embeddings.forEach((embedding, embeddingIndex) => {
/* istanbul ignore else */
if (embedding.mime_type === 'application/json' || embedding.media && embedding.media.type === 'application/json') {
step.json = (step.json ? step.json : []).concat([ JSON.parse(embedding.data) ]);
step.json = (step.json ? step.json : []).concat([typeof embedding.data === 'string' ? JSON.parse(embedding.data) : embedding.data]);
} else if (embedding.mime_type === 'text/html' || (embedding.media && embedding.media.type === 'text/html')) {
step.html = (step.html ? step.html : []).concat([
_isBase64(embedding.data) ? Base64.decode(embedding.data) :
Expand Down

0 comments on commit ed13e60

Please sign in to comment.