Use Array.isArray instead of hasOwn

This commit is contained in:
toasted-nutbread 2020-02-15 12:32:45 -05:00
parent 1f62dfa572
commit cae8ed2767

View File

@ -168,10 +168,8 @@ async function audioInject(definition, fields, sources, optionsContext) {
}
try {
let audioSourceDefinition = definition;
if (hasOwn(definition, 'expressions')) {
audioSourceDefinition = definition.expressions[0];
}
const expressions = definition.expressions;
const audioSourceDefinition = Array.isArray(expressions) ? expressions[0] : definition;
const {url} = await audioGetFromSources(audioSourceDefinition, sources, optionsContext, true);
if (url !== null) {