remix-flat-routes
Advanced tools
Comparing version 0.5.4 to 0.5.5
# CHANGELOG | ||
## v0.5.3 | ||
## v0.5.5 | ||
- 🐛 Handle optional segments with param [#30](https://github.com/kiliman/remix-flat-routes/issues/30) | ||
## v0.5.4 | ||
- 🐛 Fix route matching on Windows | ||
@@ -6,0 +10,0 @@ |
@@ -251,2 +251,6 @@ "use strict"; | ||
} | ||
// handle optional segments with param: ($segment) => :segment? | ||
} | ||
else if (segment.startsWith(`(${paramPrefixChar}`)) { | ||
result += `/:${segment.slice(2, segment.length - 1)}?`; | ||
// handle optional segments: (segment) => segment? | ||
@@ -319,3 +323,4 @@ } | ||
if (routeSegment.includes(paramPrefixChar) && | ||
!routeSegment.startsWith(paramPrefixChar)) { | ||
!(routeSegment.startsWith(paramPrefixChar) || | ||
routeSegment.startsWith(`(${paramPrefixChar}`))) { | ||
throw new Error(`Route params must start with prefix char ${paramPrefixChar}: ${routeSegment}`); | ||
@@ -322,0 +327,0 @@ } |
{ | ||
"name": "remix-flat-routes", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"description": "Package for generating routes using flat convention", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51431
611