Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/core-11-bug-fixes' into …
Browse files Browse the repository at this point in the history
…develop
  • Loading branch information
s3bba committed Feb 12, 2024
2 parents 219c30a + c24c12e commit 917e9a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ function match_dynamic_path(
const target_segments: string[] = target.split('/');
const contains_wildcard: boolean = target.includes(":*");

if (!contains_wildcard && path_segments.length !== target_segments.length) {
return [false, null];
}

if (contains_wildcard) {
// TODO (sebba): Implement wildcards support - we should probably match wildcards after all dynamic segments have been matched?
throw new Error("Wildcards are not supported yet")
}

if (path_segments.length !== target_segments.length) {
return [false, null];
}

const dynamic_segments: DynamicSegment[] = [];

// Check if the path matches the target segment by segment
Expand Down Expand Up @@ -106,7 +106,7 @@ function create_ref_node(
view: View
): HTMLElement {
// Check if the view has any children - we can't create a ref node if it doesn't
if (view.children.length != 0) {
if (view.children.length !== 0) {
// We have at least one child, create a ref node before the first child
const placement_ref_node: HTMLElement = view.children[0].element();

Expand Down Expand Up @@ -346,4 +346,4 @@ export class Router {
this.compose_view(path, path, view, data);
}

}
}

0 comments on commit 917e9a6

Please sign in to comment.