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 { try {
let audioSourceDefinition = definition; const expressions = definition.expressions;
if (hasOwn(definition, 'expressions')) { const audioSourceDefinition = Array.isArray(expressions) ? expressions[0] : definition;
audioSourceDefinition = definition.expressions[0];
}
const {url} = await audioGetFromSources(audioSourceDefinition, sources, optionsContext, true); const {url} = await audioGetFromSources(audioSourceDefinition, sources, optionsContext, true);
if (url !== null) { if (url !== null) {