Replace filter()[0] with find()

This commit is contained in:
Albin Larsson 2018-06-19 00:24:27 +02:00
parent c45f428f61
commit 94055f0772

View File

@ -39,7 +39,7 @@ const html5 = {
get() {
// Get sources
const sources = html5.getSources.call(player);
const [source] = sources.filter(source => source.getAttribute('src') === player.source);
const source = sources.find(source => source.getAttribute('src') === player.source);
// Return size, if match is found
return source && Number(source.getAttribute('size'));