Forráskód Böngészése

Translator: refactor interpolate (#2903)

* Translator: refactor interpolate

Fixes types and small code edits:
`<regex>[Symbol.split](<string>)` is equivalent to
`String.prototype.split.call(<string>, <regex>)` and potentially more
readable (the downside it's not compatible with IE, which may be why we
currently use the latter).

Refs: https://github.com/transloadit/uppy/pull/2899

* Update packages/@uppy/utils/src/Translator.js

* Revert RegExp Symbol for IE compat
Antoine du Hamel 3 éve
szülő
commit
4575d67f07
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      packages/@uppy/utils/src/Translator.js

+ 1 - 1
packages/@uppy/utils/src/Translator.js

@@ -52,7 +52,7 @@ module.exports = class Translator {
    *
    * @param {string} phrase that needs interpolation, with placeholders
    * @param {object} options with values that will be used to replace placeholders
-   * @returns {string} interpolated
+   * @returns {any[]} interpolated
    */
   interpolate (phrase, options) {
     const { split, replace } = String.prototype