diesel-core 1.7.5 → 2.0.2

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/README.md CHANGED
@@ -1,9 +1,11 @@
1
+ [![Downloads](https://img.shields.io/npm/dm/@nativecn/cli.svg)](https://www.npmjs.com/package/diesel-core)
2
+
1
3
  ### [Read the docs](https://diesel-core.vercel.app/)
2
4
 
3
5
  # DieselJS
4
6
 
5
7
 
6
- **Diesel** is a simple and lightweight HTTP server library for Bun.js that provides you with complete control over your API routes and middleware. It is designed to be intuitive and efficient, allowing you to quickly set up a server, define routes, and optimize important paths for faster response times.
8
+ **Diesel** is a simple and lightweight HTTP server library for Bun.js that provides you with complete control over your API routes and middleware. It is designed to be intuitive and efficient, allowing you to quickly set up a server, define routes, and optimize important paths for faster response times. started this on 5th october 2024
7
9
 
8
10
  **Now Supports Node.js & Cloduflare adaptors**
9
11
 
@@ -1 +1,2 @@
1
1
  export declare const supportedMethods: string[];
2
+ export declare const EMPTY_OBJ: Readonly<{}>;
package/dist/constant.js CHANGED
@@ -1 +1 @@
1
- var A=Object.create;var{getPrototypeOf:D,defineProperty:t,getOwnPropertyNames:p,getOwnPropertyDescriptor:N}=Object,s=Object.prototype.hasOwnProperty;var d=(P,T,E)=>{E=P!=null?A(D(P)):{};let o=T||!P||!P.__esModule?t(E,"default",{value:P,enumerable:!0}):E;for(let O of p(P))if(!s.call(o,O))t(o,O,{get:()=>P[O],enumerable:!0});return o},e=new WeakMap,r=(P)=>{var T=e.get(P),E;if(T)return T;if(T=t({},"__esModule",{value:!0}),P&&typeof P==="object"||typeof P==="function")p(P).map((o)=>!s.call(T,o)&&t(T,o,{get:()=>P[o],enumerable:!(E=N(P,o))||E.enumerable}));return e.set(P,T),T},H=(P,T)=>()=>(T||P((T={exports:{}}).exports,T),T.exports);var I=(P,T)=>{for(var E in T)t(P,E,{get:T[E],enumerable:!0,configurable:!0,set:(o)=>T[E]=()=>o})};var S=(P,T)=>()=>(P&&(T=P(P=0)),T);var h=["GET","POST","PUT","PATCH","DELETE","ANY","HEAD","OPTIONS","PROPFIND"];export{h as supportedMethods};
1
+ var e=["GET","POST","PUT","PATCH","DELETE","ANY","ALL","HEAD","OPTIONS","PROPFIND"],t=Object.freeze({});export{e as supportedMethods,t as EMPTY_OBJ};
package/dist/ctx.d.ts CHANGED
@@ -2,19 +2,18 @@ import { Server } from "bun";
2
2
  import type { CookieOptions } from "./types";
3
3
  export declare class Context {
4
4
  req: Request;
5
- server: Server | null;
5
+ server?: Server;
6
6
  path: string | null;
7
- paramNames: string[] | Record<string, string>;
8
- env: Record<string, any> | null;
9
- executionContext: any | null;
7
+ param: Record<string, string> | undefined;
8
+ env?: Record<string, any>;
9
+ executionContext?: any;
10
10
  headers: Headers | null;
11
11
  private parsedQuery;
12
- private parsedParams;
13
12
  private parsedCookies;
14
13
  private parsedBody;
15
14
  private contextData;
16
15
  private urlObject;
17
- constructor(req: Request, server: Server | null, path: string | null, paramNames: string[] | Record<string, string>, env: Record<string, any> | null, executionContext: any | null);
16
+ constructor(req: Request, server: Server | undefined, path: string | null, param: Record<string, string> | undefined, env: Record<string, any> | undefined, executionContext: any | undefined);
18
17
  setHeader(key: string, value: string): this;
19
18
  removeHeader(key: string): this;
20
19
  set<T>(key: string, value: T): this;
@@ -37,3 +36,4 @@ export declare class Context {
37
36
  }
38
37
  export declare function extractParam(paramNames: string[], incomingPath: string): Record<string, string>;
39
38
  export declare function extractDynamicParams(originalPath: string, incomingPath: string): Record<string, string> | null;
39
+ export declare function parseParams(inComingpath: string | null, param: Record<string, number> | null): Record<string, any>;