next-translate-routes-multi-domain
Version:
Flexible and translated routes for Next.js without custom server
13 lines • 601 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.fileNameToPath = void 0;
var regex_1 = require("../shared/regex");
/** Transform Next file-system synthax to path-to-regexp synthax */
var fileNameToPath = function (fileName) {
return fileName
.replace(regex_1.optionalMatchAllFilepathPartsRegex, ':$1*') // [[...param]]
.replace(regex_1.matchAllFilepathPartsRegex, ':$1+') // [...param]
.replace(regex_1.dynamicFilepathPartsRegex, ':$1');
}; // [param]
exports.fileNameToPath = fileNameToPath;
//# sourceMappingURL=fileNameToPaths.js.map