| 123456789101112131415161718192021222324 |
- 'use strict';
- function encodePagesPath(pages) {
- pages.forEach(function(page) {
- if (!page.path) {
- return;
- }
- page.path = encodePagePath(page.path);
- });
- return pages;
- }
- function encodePagePath(path) {
- var paths = path.split('/');
- paths.forEach(function(item, index) {
- paths[index] = encodeURIComponent(item);
- });
- return paths.join('/');
- }
- module.exports = {
- encodePagePath: encodePagePath,
- encodePagesPath: encodePagesPath
- };
|