Przeglądaj źródła

Object rest spread

Renée Kooi 6 lat temu
rodzic
commit
0f4f7dffff
1 zmienionych plików z 6 dodań i 3 usunięć
  1. 6 3
      packages/@uppy/aws-s3/src/index.js

+ 6 - 3
packages/@uppy/aws-s3/src/index.js

@@ -39,9 +39,12 @@ module.exports = class AwsS3 extends Plugin {
       locale: defaultLocale
       locale: defaultLocale
     }
     }
 
 
-    this.opts = Object.assign({}, defaultOptions, opts)
-    this.locale = Object.assign({}, defaultLocale, this.opts.locale)
-    this.locale.strings = Object.assign({}, defaultLocale.strings, this.opts.locale.strings)
+    this.opts = { ...defaultOptions, ...opts }
+    this.locale = {
+      ...defaultLocale,
+      ...this.opts.locale,
+      strings: { ...defaultLocale.strings, ...this.opts.locale.strings }
+    }
 
 
     this.translator = new Translator({ locale: this.locale })
     this.translator = new Translator({ locale: this.locale })
     this.i18n = this.translator.translate.bind(this.translator)
     this.i18n = this.translator.translate.bind(this.translator)