From 571e06a35c2b26122979d6862914e21967e006fb Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Thu, 22 Feb 2024 10:06:52 +0100 Subject: chore(files): replace `encodeFilePath` by `encodePath` from `@nextcloud/paths` Signed-off-by: skjnldsv --- apps/files/src/utils/fileUtils.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'apps/files/src/utils') diff --git a/apps/files/src/utils/fileUtils.ts b/apps/files/src/utils/fileUtils.ts index 126739242a0..1f7e3078da9 100644 --- a/apps/files/src/utils/fileUtils.ts +++ b/apps/files/src/utils/fileUtils.ts @@ -19,9 +19,9 @@ * along with this program. If not, see . * */ +import { basename, extname } from 'path' import { FileType, type Node } from '@nextcloud/files' import { translate as t, translatePlural as n } from '@nextcloud/l10n' -import { basename, extname } from 'path' // TODO: move to @nextcloud/files /** @@ -41,17 +41,6 @@ export const getUniqueName = (name: string, otherNames: string[], suffix = (n: n return newName } -export const encodeFilePath = function(path) { - const pathSections = (path.startsWith('/') ? path : `/${path}`).split('/') - let relativePath = '' - pathSections.forEach((section) => { - if (section !== '') { - relativePath += '/' + encodeURIComponent(section) - } - }) - return relativePath -} - /** * Extract dir and name from file path * -- cgit v1.2.3