From 1e86e4f3f3d8de854d2a6981fb8c042778165949 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 1 Aug 2022 14:58:21 +0200 Subject: [PATCH] @uppy/url: remove private methods from public API --- packages/@uppy/url/src/Url.jsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/@uppy/url/src/Url.jsx b/packages/@uppy/url/src/Url.jsx index 00a4c84044..5b62945dba 100644 --- a/packages/@uppy/url/src/Url.jsx +++ b/packages/@uppy/url/src/Url.jsx @@ -106,8 +106,8 @@ export default class Url extends UIPlugin { } async addFile (protocollessUrl, optionalMeta = undefined) { - const url = this.addProtocolToURL(protocollessUrl) - if (!this.checkIfCorrectURL(url)) { + const url = addProtocolToURL(protocollessUrl) + if (!checkIfCorrectURL(url)) { this.uppy.log(`[URL] Incorrect URL entered: ${url}`) this.uppy.info(this.i18n('enterCorrectUrl'), 'error', 4000) return undefined @@ -119,7 +119,7 @@ export default class Url extends UIPlugin { const tagFile = { meta: optionalMeta, source: this.id, - name: this.getFileNameFromUrl(url), + name: getFileNameFromUrl(url), type: meta.type, data: { size: meta.size, @@ -187,8 +187,6 @@ export default class Url extends UIPlugin { } } -// TODO: remove from prototype in the next major. -Url.prototype.addProtocolToURL = addProtocolToURL +// This is defined outside of the class body because it's not using `this`, but +// we still want it available on the prototype so the Dashboard can access it. Url.prototype.canHandleRootDrop = canHandleRootDrop -Url.prototype.checkIfCorrectURL = checkIfCorrectURL -Url.prototype.getFileNameFromUrl = getFileNameFromUrl