@mapl/web 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/handler.d.ts +1 -1
- package/core/handler.js +1 -1
- package/core/utils.d.ts +0 -4
- package/core/utils.js +1 -1
- package/package.json +7 -7
package/core/handler.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type DefineHandler = <
|
|
|
11
11
|
S = {}
|
|
12
12
|
>(path: P, handler: Handler<InferPath<P>, Required<S>>, ...dat: HandlerData[]) => HandlerTag<S>;
|
|
13
13
|
export interface HandlerData extends Record<symbol, any> {
|
|
14
|
-
type?: "json" | "html" | "raw";
|
|
14
|
+
type?: "json" | "html" | "raw" | null;
|
|
15
15
|
}
|
|
16
16
|
export type InferPath<T extends string> = T extends `${string}*${infer Next}` ? Next extends "*" ? [string] : [string, ...InferPath<Next>] : [];
|
|
17
17
|
declare const handlerTag: unique symbol;
|
package/core/handler.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export let json={type:`json`};export let html={type:`html`};export let raw={type:`raw`};let noType={type:null};export let error=(r,f,...dat)=>{r[2]=[f,dat.length===0?noType:Object.assign({type:null},...dat)];return r};export let route=(method,path,handler,...dat)=>[method,path,handler,dat.length===0?noType:Object.assign({type:null},...dat)];export let any=(...a)=>route(``,...a);export let get=(...a)=>route(`GET`,...a);export let post=(...a)=>route(`POST`,...a);export let put=(...a)=>route(`PUT`,...a);export let del=(...a)=>route(`DELETE`,...a);export let patch=(...a)=>route(`PATCH`,...a);export let options=(...a)=>route(`OPTIONS`,...a);export let trace=(...a)=>route(`TRACE`,...a);
|
package/core/utils.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
export type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
|
2
2
|
export type AwaitedReturn<U extends (...a: any[]) => any> = Awaited<ReturnType<U>>;
|
|
3
|
-
export declare const proto: <
|
|
4
|
-
A extends {},
|
|
5
|
-
T extends any[]
|
|
6
|
-
>(a: A, ...f: T) => A & UnionToIntersection<T[number]>;
|
package/core/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export{};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapl/web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "A compiled web framework for all runtimes",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": {
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
},
|
|
19
19
|
"exports": {
|
|
20
20
|
"./constants": "./constants.js",
|
|
21
|
-
"./utils/cors": "./utils/cors.js",
|
|
22
|
-
"./core/context": "./core/context.js",
|
|
23
|
-
"./core/middleware": "./core/middleware.js",
|
|
24
|
-
"./core": "./core/index.js",
|
|
25
|
-
"./core/compile": "./core/compile.js",
|
|
26
21
|
".": "./index.js",
|
|
22
|
+
"./core/compile": "./core/compile.js",
|
|
23
|
+
"./core": "./core/index.js",
|
|
27
24
|
"./core/utils": "./core/utils.js",
|
|
28
|
-
"./core/
|
|
25
|
+
"./core/middleware": "./core/middleware.js",
|
|
26
|
+
"./core/handler": "./core/handler.js",
|
|
27
|
+
"./utils/cors": "./utils/cors.js",
|
|
28
|
+
"./core/context": "./core/context.js"
|
|
29
29
|
}
|
|
30
30
|
}
|