UNPKG

@nimpl/router

Version:

Edge router for next.js apps (i18n, basePath, rewrites, redirects)

9 lines (8 loc) 380 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatDestination = void 0; const formatDestination = (destination, groups) => { const formattedDestination = Object.entries(groups).reduce((acc, [key, value]) => acc.replace(`:${key}`, value), destination); return formattedDestination; }; exports.formatDestination = formatDestination;