Some checks failed
CI / go (push) Waiting to run
CI / docker (push) Waiting to run
CI / lint-go (push) Waiting to run
CI / lint-docs (push) Waiting to run
CI / check-paperclip (push) Waiting to run
Deploy static site / Deploy to GitHub Pages (push) Has been cancelled
Deploy static site / Deploy via Docker to hatch.surf (push) Has been cancelled
Resolved conflicts by taking GitHub versions for: - .dockerignore, .gitignore, Dockerfile, README.md, docker-compose.yml Kept deploy.sh updated to: - Pull from GitHub (primary source) - Push to Gitea (push-mirror) - Build from site/ directory (GitHub structure) Co-Authored-By: Paperclip <noreply@paperclip.ing>
62 lines
1.8 KiB
JavaScript
62 lines
1.8 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
compareAppPaths: null,
|
|
normalizeAppPath: null,
|
|
normalizeRscURL: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
compareAppPaths: function() {
|
|
return compareAppPaths;
|
|
},
|
|
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 compareAppPaths(a, b) {
|
|
const aHasSlot = a.includes('/@');
|
|
const bHasSlot = b.includes('/@');
|
|
if (aHasSlot && !bHasSlot) return -1;
|
|
if (!aHasSlot && bHasSlot) return 1;
|
|
return a.localeCompare(b);
|
|
}
|
|
function normalizeRscURL(url) {
|
|
return url.replace(/\.rsc($|\?)/, // $1 ensures `?` is preserved
|
|
'$1');
|
|
}
|
|
|
|
//# sourceMappingURL=app-paths.js.map
|