(path: string)
| 589 | |
| 590 | /** Encode file path segments that Next.js Link would interpret as dynamic routes */ |
| 591 | export function encodeFilePath(path: string): string { |
| 592 | return path |
| 593 | .split("/") |
| 594 | .map((s) => |
| 595 | s |
| 596 | .replace(/\[/g, "%5B") |
| 597 | .replace(/\]/g, "%5D") |
| 598 | .replace(/\(/g, "%28") |
| 599 | .replace(/\)/g, "%29"), |
| 600 | ) |
| 601 | .join("/"); |
| 602 | } |
no outgoing calls
no test coverage detected