Initial boiler plate project
This commit is contained in:
51
node_modules/next/dist/shared/lib/router/utils/app-paths.js
generated
vendored
Normal file
51
node_modules/next/dist/shared/lib/router/utils/app-paths.js
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
normalizeAppPath: null,
|
||||
normalizeRscURL: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
normalizeAppPath: function() {
|
||||
return normalizeAppPath;
|
||||
},
|
||||
normalizeRscURL: function() {
|
||||
return normalizeRscURL;
|
||||
}
|
||||
});
|
||||
const _ensureleadingslash = require("../../page-path/ensure-leading-slash");
|
||||
const _segment = require("../../segment");
|
||||
function normalizeAppPath(route) {
|
||||
return (0, _ensureleadingslash.ensureLeadingSlash)(route.split("/").reduce((pathname, segment, index, segments)=>{
|
||||
// Empty segments are ignored.
|
||||
if (!segment) {
|
||||
return pathname;
|
||||
}
|
||||
// Groups are ignored.
|
||||
if ((0, _segment.isGroupSegment)(segment)) {
|
||||
return pathname;
|
||||
}
|
||||
// Parallel segments are ignored.
|
||||
if (segment[0] === "@") {
|
||||
return pathname;
|
||||
}
|
||||
// The last segment (if it's a leaf) should be ignored.
|
||||
if ((segment === "page" || segment === "route") && index === segments.length - 1) {
|
||||
return pathname;
|
||||
}
|
||||
return pathname + "/" + segment;
|
||||
}, ""));
|
||||
}
|
||||
function normalizeRscURL(url) {
|
||||
return url.replace(/\.rsc($|\?)/, // $1 ensures `?` is preserved
|
||||
"$1");
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-paths.js.map
|
||||
Reference in New Issue
Block a user