Minor naming changes
This commit is contained in:
parent
a67e7efb40
commit
c1b67ff5b2
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"typescript.tsdk": "node_modules/typescript/lib"
|
"typescript.tsdk": "node_modules/typescript/lib",
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ const matchesRoute = <T extends Route.Route.Any>(route: T, pathComponents: reado
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const parseRoute = <T extends Route.Route.Any>(route: T) => {
|
const makeRouteParser = <T extends Route.Route.Any>(route: T) => {
|
||||||
const decoder = pipe(
|
const decoder = pipe(
|
||||||
route,
|
route,
|
||||||
A.filterMap((r) => r._tag === "Param" ? O.some([r.name, r.schema] as const) : O.none()),
|
A.filterMap((r) => r._tag === "Param" ? O.some([r.name, r.schema] as const) : O.none()),
|
||||||
@ -54,13 +54,13 @@ const parseRoute = <T extends Route.Route.Any>(route: T) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const parseQuery = <T extends Query.Query.Any>(query: T) => {
|
const makeQueryParser = <T extends Query.Query.Any>(query: T) => {
|
||||||
const decoder = pipe();
|
const decoder = pipe();
|
||||||
|
|
||||||
return (searchParams: URLSearchParams) => pipe();
|
return (searchParams: URLSearchParams) => pipe();
|
||||||
};
|
};
|
||||||
|
|
||||||
const parseBody = <T extends RequestBody.RequestBody.Any>(requestBody: T) => {
|
const makeBodyParser = <T extends RequestBody.RequestBody.Any>(requestBody: T) => {
|
||||||
const decoder = pipe(
|
const decoder = pipe(
|
||||||
Match.value<RequestBody.RequestBody.Any>(requestBody),
|
Match.value<RequestBody.RequestBody.Any>(requestBody),
|
||||||
Match.tags({
|
Match.tags({
|
||||||
@ -76,9 +76,9 @@ const parseBody = <T extends RequestBody.RequestBody.Any>(requestBody: T) => {
|
|||||||
return (req: Request) => pipe();
|
return (req: Request) => pipe();
|
||||||
};
|
};
|
||||||
|
|
||||||
const routeParser = parseRoute(getUsers.props.route);
|
const routeParser = makeRouteParser(getUsers.props.route);
|
||||||
const queryParser = parseQuery(getUsers.props.query);
|
const queryParser = makeQueryParser(getUsers.props.query);
|
||||||
const bodyParser = parseBody(getUsers.props.request);
|
const bodyParser = makeBodyParser(getUsers.props.request);
|
||||||
|
|
||||||
Bun.serve({
|
Bun.serve({
|
||||||
fetch: (req) => {
|
fetch: (req) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user