Replace filter()[0] with find()
This commit is contained in:
parent
c45f428f61
commit
94055f0772
@ -39,7 +39,7 @@ const html5 = {
|
|||||||
get() {
|
get() {
|
||||||
// Get sources
|
// Get sources
|
||||||
const sources = html5.getSources.call(player);
|
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 size, if match is found
|
||||||
return source && Number(source.getAttribute('size'));
|
return source && Number(source.getAttribute('size'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user