aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/audio.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/audio.js')
-rw-r--r--ext/bg/js/audio.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/bg/js/audio.js b/ext/bg/js/audio.js
index cd42a158..dc0ba5eb 100644
--- a/ext/bg/js/audio.js
+++ b/ext/bg/js/audio.js
@@ -107,12 +107,12 @@ const audioUrlBuilders = {
'custom': async (definition, optionsContext) => {
const options = await apiOptionsGet(optionsContext);
const customSourceUrl = options.audio.customSourceUrl;
- return customSourceUrl.replace(/\{([^\}]*)\}/g, (m0, m1) => (definition.hasOwnProperty(m1) ? `${definition[m1]}` : m0));
+ return customSourceUrl.replace(/\{([^}]*)\}/g, (m0, m1) => (hasOwn(definition, m1) ? `${definition[m1]}` : m0));
}
};
async function audioGetUrl(definition, mode, optionsContext, download) {
- if (audioUrlBuilders.hasOwnProperty(mode)) {
+ if (hasOwn(audioUrlBuilders, mode)) {
const handler = audioUrlBuilders[mode];
try {
return await handler(definition, optionsContext, download);
@@ -133,7 +133,7 @@ function audioUrlNormalize(url, baseUrl, basePath) {
// Begins with "/"
url = baseUrl + url;
}
- } else if (!/^[a-z][a-z0-9\+\-\.]*:/i.test(url)) {
+ } else if (!/^[a-z][a-z0-9\-+.]*:/i.test(url)) {
// No URI scheme => relative path
url = baseUrl + basePath + url;
}
@@ -171,7 +171,7 @@ async function audioInject(definition, fields, sources, optionsContext) {
try {
let audioSourceDefinition = definition;
- if (definition.hasOwnProperty('expressions')) {
+ if (hasOwn(definition, 'expressions')) {
audioSourceDefinition = definition.expressions[0];
}