Skip to content

Commit

Permalink
@uppy/companion: show deprecation message when using legacy s3 options (
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Aug 3, 2022
1 parent 51fac3b commit cd2b6e4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/config/companion.js
Expand Up @@ -89,10 +89,10 @@ const validateConfig = (companionOptions) => {
const { providerOptions, periodicPingUrls } = companionOptions

if (providerOptions) {
const deprecatedOptions = { microsoft: 'onedrive', google: 'drive' }
Object.keys(deprecatedOptions).forEach((deprected) => {
if (providerOptions[deprected]) {
throw new Error(`The Provider option "${deprected}" is no longer supported. Please use the option "${deprecatedOptions[deprected]}" instead.`)
const deprecatedOptions = { microsoft: 'providerOptions.onedrive', google: 'providerOptions.drive', s3: 's3' }
Object.keys(deprecatedOptions).forEach((deprecated) => {
if (Object.prototype.hasOwnProperty.call(providerOptions, deprecated)) {
throw new Error(`The Provider option "providerOptions.${deprecated}" is no longer supported. Please use the option "${deprecatedOptions[deprecated]}" instead.`)
}
})
}
Expand Down

0 comments on commit cd2b6e4

Please sign in to comment.