(chunk: string)
| 344 | * @returns Returns the converted chunk |
| 345 | */ |
| 346 | export const convertRemixPathToUrl = (chunk: string) => { |
| 347 | if (chunk.startsWith("__") || chunk.startsWith("_") || chunk.includes("index") || chunk.includes("route")) { |
| 348 | return ""; |
| 349 | } |
| 350 | return chunk.replace(/_/g, "").replace(/\[/g, ":").replace(/\]/g, "").replace("+", ""); |
| 351 | }; |
| 352 | /** |
| 353 | * Method to generate the final path to open in browser |
| 354 | * @param prefix Url prefix eg http://localhost:3000 |