mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +00:00
clean up
This commit is contained in:
@@ -104,14 +104,13 @@ export function select_target(url: URL): Target {
|
||||
// avoid accidental clashes between server routes and page routes
|
||||
if (ignore.some(pattern => pattern.test(path))) return;
|
||||
|
||||
const query: Query = extract_query(url.search)
|
||||
|
||||
for (let i = 0; i < routes.length; i += 1) {
|
||||
const route = routes[i];
|
||||
|
||||
const match = route.pattern.exec(path);
|
||||
|
||||
if (match) {
|
||||
const query: Query = extract_query(url.search);
|
||||
const part = route.parts[route.parts.length - 1];
|
||||
const params = part.params ? part.params(match) : {};
|
||||
|
||||
@@ -141,7 +140,7 @@ export function handle_error(url: URL) {
|
||||
segments: preloaded
|
||||
|
||||
}
|
||||
const query = extract_query(search)
|
||||
const query = extract_query(search);
|
||||
render(null, [], props, { path: pathname, query, params: {} });
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ export default function start(opts: {
|
||||
|
||||
history.replaceState({ id: uid }, '', href);
|
||||
|
||||
const url = new URL(location.href)
|
||||
const url = new URL(location.href);
|
||||
|
||||
if (initial_data.error) return handle_error(url);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user