File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -122,12 +122,9 @@ function compute(path) {
122
122
123
123
// Version removal
124
124
const match = path . match ( / ^ \/ d o c s \/ (?: s u r r e a l d b \/ ) ? ( [ ^ \/ ] + ) ( \/ .* ) ? $ / ) ;
125
- if ( match ) {
126
- const [ , , section , rest ] = match ;
127
- if ( versions . includes ( section ) ) {
128
- // biome-ignore lint/style/noParameterAssign:
129
- path = `/docs/surrealdb${ rest || '' } ` ;
130
- }
125
+ if ( match && versions . includes ( match [ 1 ] ) ) {
126
+ // biome-ignore lint/style/noParameterAssign:
127
+ path = `/docs/surrealdb${ match [ 2 ] || '' } ` ;
131
128
}
132
129
133
130
// Prefixed redirects
@@ -169,7 +166,7 @@ function handler(event) {
169
166
// Do we redirect to fix the URL first?
170
167
if (
171
168
host !== 'surrealdb.com' ||
172
- ( ! computed . raw && computed . path !== request . uri )
169
+ ( ! computed . raw && ( computed . path !== request . uri ) )
173
170
) {
174
171
return {
175
172
statusCode : 301 ,
You can’t perform that action at this time.
0 commit comments