restructure project, add claudemd
This commit is contained in:
15
web/runtime/@solidjs/router/dist/routers/StaticRouter.js
vendored
Normal file
15
web/runtime/@solidjs/router/dist/routers/StaticRouter.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { getRequestEvent } from "solid-js/web";
|
||||
import { createRouterComponent } from "./components.js";
|
||||
function getPath(url) {
|
||||
const u = new URL(url);
|
||||
return u.pathname + u.search;
|
||||
}
|
||||
export function StaticRouter(props) {
|
||||
let e;
|
||||
const obj = {
|
||||
value: props.url || ((e = getRequestEvent()) && getPath(e.request.url)) || "",
|
||||
};
|
||||
return createRouterComponent({
|
||||
signal: [() => obj, next => Object.assign(obj, next)]
|
||||
})(props);
|
||||
}
|
||||
Reference in New Issue
Block a user