Skip to content

Commit ef47c8e

Browse files
vikaspotluri123acburdine
authored andcommitted
perf(release-notes): prefer find() over filter()[0]
no issue - find() does the same thing as filter()[0] but breaks after the first match
1 parent 881211b commit ef47c8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/tasks/release-notes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = async (ctx, task) => {
99
return;
1010
}
1111

12-
const relevantNotes = response.body.filter(note => note.tag_name.replace('v', '') === ctx.version)[0];
12+
const relevantNotes = response.body.find(note => note.tag_name.replace('v', '') === ctx.version);
1313

1414
if (!relevantNotes) {
1515
task.title = 'Release notes were not found';

0 commit comments

Comments
 (0)