Skip to content

Commit

Permalink
add misc field to generator
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane committed Jan 1, 2018
1 parent 0b04a7a commit d55b465
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ const output = sep
const bodyJoined = body.join('\n');
return [hash, bodyJoined];
})
.filter(([, body]) => /^[\w]+: [^ ]/.test(body))
// .filter(([, body]) => )
.map(([hash, bodyJoined]) => {
const [section, body] = bodyJoined.split(/: /);
return [hash, section, body];
const hasSection = /^[\w]+: [^ ]/.test(bodyJoined);
if (hasSection) {
const [section, body] = bodyJoined.split(/: /);
return [hash, section, body];
}
return [hash, 'misc', bodyJoined];
})
.reduce((acc, item) => {
const [, section] = item;
Expand Down

0 comments on commit d55b465

Please sign in to comment.