Просмотр исходного кода

remove encodePagePath/encodePagesPath

Yuki Takei 5 лет назад
Родитель
Сommit
12cee77a8f
1 измененных файлов с 0 добавлено и 36 удалено
  1. 0 36
      packages/growi-commons/src/util/path-utils.js

+ 0 - 36
packages/growi-commons/src/util/path-utils.js

@@ -1,37 +1,3 @@
-/**
- * Encode specified `path`
- *  with [encodeURIComponent]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent}.
- *
- * @param {string} path
- * @returns {string}
- * @memberof pathUtils
- */
-function encodePagePath(path) {
-  const paths = path.split('/');
-  paths.forEach((item, index) => {
-    paths[index] = encodeURIComponent(item);
-  });
-  return paths.join('/');
-}
-
-/**
- * Encode specified `pages` with
- *  [encodeURIComponent]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent}.
- *
- * @param {Page[]} pages
- * @returns {string}
- * @memberof pathUtils
- */
-function encodePagesPath(pages) {
-  pages.forEach((page) => {
-    if (!page.path) {
-      return;
-    }
-    page.path = encodePagePath(page.path);
-  });
-  return pages;
-}
-
 /**
  * @private
  *
@@ -135,8 +101,6 @@ function normalizePath(path) {
  * @namespace pathUtils
  */
 module.exports = {
-  encodePagePath,
-  encodePagesPath,
   hasHeadingSlash,
   hasTrailingSlash,
   addHeadingSlash,