Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function addRemoteProvider (uppy, name, opts) {
const Provider = remoteProviders[name]
const providerOptions = {
// Default to the :tl: Companion servers.
companionUrl: Transloadit.COMPANION,
companionAllowedHosts: Transloadit.COMPANION_PATTERN
}
remoteProviderOptionNames.forEach((name) => {
if (has(opts, name)) providerOptions[name] = opts[name]
})
// Apply overrides for a specific provider plugin.
if (typeof opts[name] === 'object') {
Object.assign(providerOptions, opts[name])
}
uppy.use(Provider, providerOptions)
}