@cfworker/web 5.0.1 → 5.0.3
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/dist/{types → commonjs}/normalize-pathname.d.ts +1 -1
- package/dist/{cjs → commonjs}/normalize-pathname.js +2 -2
- package/dist/commonjs/package.json +3 -0
- package/dist/esm/accepts.d.ts +12 -0
- package/dist/esm/application.d.ts +11 -0
- package/dist/esm/context.d.ts +15 -0
- package/dist/esm/cookies.d.ts +8 -0
- package/dist/esm/http-error.d.ts +7 -0
- package/dist/esm/middleware.d.ts +3 -0
- package/dist/esm/normalize-pathname.d.ts +3 -0
- package/dist/esm/normalize-pathname.js +1 -1
- package/dist/esm/package.json +3 -0
- package/dist/esm/req.d.ts +24 -0
- package/dist/esm/response-builder.d.ts +22 -0
- package/dist/esm/router.d.ts +39 -0
- package/dist/esm/validate.d.ts +21 -0
- package/package.json +34 -31
- package/dist/tsconfig.cjs.tsbuildinfo +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/src/accepts.ts +0 -87
- package/src/application.ts +0 -55
- package/src/context.ts +0 -27
- package/src/cookies.ts +0 -30
- package/src/declarations.d.ts +0 -10
- package/src/http-error.ts +0 -36
- package/src/middleware.ts +0 -34
- package/src/normalize-pathname.ts +0 -22
- package/src/req.ts +0 -59
- package/src/response-builder.ts +0 -158
- package/src/router.ts +0 -146
- package/src/validate.ts +0 -121
- /package/dist/{types → commonjs}/accepts.d.ts +0 -0
- /package/dist/{cjs → commonjs}/accepts.js +0 -0
- /package/dist/{types → commonjs}/application.d.ts +0 -0
- /package/dist/{cjs → commonjs}/application.js +0 -0
- /package/dist/{types → commonjs}/context.d.ts +0 -0
- /package/dist/{cjs → commonjs}/context.js +0 -0
- /package/dist/{types → commonjs}/cookies.d.ts +0 -0
- /package/dist/{cjs → commonjs}/cookies.js +0 -0
- /package/dist/{types → commonjs}/http-error.d.ts +0 -0
- /package/dist/{cjs → commonjs}/http-error.js +0 -0
- /package/dist/{types → commonjs}/index.d.ts +0 -0
- /package/dist/{cjs → commonjs}/index.js +0 -0
- /package/dist/{types → commonjs}/middleware.d.ts +0 -0
- /package/dist/{cjs → commonjs}/middleware.js +0 -0
- /package/dist/{types → commonjs}/req.d.ts +0 -0
- /package/dist/{cjs → commonjs}/req.js +0 -0
- /package/dist/{types → commonjs}/response-builder.d.ts +0 -0
- /package/dist/{cjs → commonjs}/response-builder.js +0 -0
- /package/dist/{types → commonjs}/router.d.ts +0 -0
- /package/dist/{cjs → commonjs}/router.js +0 -0
- /package/dist/{types → commonjs}/validate.d.ts +0 -0
- /package/dist/{cjs → commonjs}/validate.js +0 -0
- /package/{src/index.ts → dist/esm/index.d.ts} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizePathnameMiddleware = void 0;
|
|
4
4
|
exports.normalizePathname = normalizePathname;
|
|
5
|
-
const
|
|
5
|
+
const http_error_js_1 = require("./http-error.js");
|
|
6
6
|
function normalizePathname(pathname) {
|
|
7
7
|
return decodeURIComponent(pathname).replace(/\/\/+/g, '/').normalize();
|
|
8
8
|
}
|
|
@@ -13,7 +13,7 @@ const normalizePathnameMiddleware = async ({ req }, next) => {
|
|
|
13
13
|
}
|
|
14
14
|
catch (err) {
|
|
15
15
|
if (err instanceof URIError) {
|
|
16
|
-
throw new
|
|
16
|
+
throw new http_error_js_1.HttpError(400, `Unable to decode pathname "${pathname}".`);
|
|
17
17
|
}
|
|
18
18
|
throw err;
|
|
19
19
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class Accepts {
|
|
2
|
+
private readonly headers;
|
|
3
|
+
private _type;
|
|
4
|
+
private _language;
|
|
5
|
+
private _encoding;
|
|
6
|
+
private _charset;
|
|
7
|
+
constructor(headers: Headers);
|
|
8
|
+
type<T extends string>(...values: T[]): T | false;
|
|
9
|
+
language<T extends string>(...values: T[]): T | false;
|
|
10
|
+
encoding<T extends string>(...values: T[]): T | false;
|
|
11
|
+
charset<T extends string>(...values: T[]): T | false;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Middleware } from './middleware.js';
|
|
2
|
+
export declare class Application {
|
|
3
|
+
private readonly middleware;
|
|
4
|
+
private _composedMiddleware?;
|
|
5
|
+
private get composedMiddleware();
|
|
6
|
+
use(middleware: Middleware): Application;
|
|
7
|
+
handleRequest(request: Request, env: any, context: {
|
|
8
|
+
waitUntil(promise: Promise<any>): void;
|
|
9
|
+
}): Promise<Response>;
|
|
10
|
+
private invokeMiddleware;
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Cookies } from './cookies.js';
|
|
2
|
+
import { Req } from './req.js';
|
|
3
|
+
import { ResponseBuilder } from './response-builder.js';
|
|
4
|
+
export declare class Context {
|
|
5
|
+
readonly environmentBindings: any;
|
|
6
|
+
private readonly _context;
|
|
7
|
+
readonly req: Req;
|
|
8
|
+
readonly res: ResponseBuilder;
|
|
9
|
+
readonly cookies: Cookies;
|
|
10
|
+
readonly state: any;
|
|
11
|
+
constructor(request: Request, environmentBindings: any, _context: {
|
|
12
|
+
waitUntil(promise: Promise<any>): void;
|
|
13
|
+
});
|
|
14
|
+
waitUntil(promise: Promise<any>): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SerializeOptions } from 'cookie';
|
|
2
|
+
export declare class Cookies {
|
|
3
|
+
private readonly responseHeaders;
|
|
4
|
+
private readonly requestCookies;
|
|
5
|
+
constructor(requestHeaders: Headers, responseHeaders: Headers);
|
|
6
|
+
get(name: string): string | null;
|
|
7
|
+
set(name: string, val: string, options?: SerializeOptions): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Reviver } from 'secure-json-parse';
|
|
2
|
+
import { Accepts } from './accepts.js';
|
|
3
|
+
export declare class Req {
|
|
4
|
+
readonly raw: Request;
|
|
5
|
+
readonly method: string;
|
|
6
|
+
readonly url: URL;
|
|
7
|
+
readonly headers: Headers;
|
|
8
|
+
readonly params: Record<string, string>;
|
|
9
|
+
readonly accepts: Accepts;
|
|
10
|
+
readonly body: ReqBody;
|
|
11
|
+
constructor(request: Request);
|
|
12
|
+
}
|
|
13
|
+
export declare class ReqBody {
|
|
14
|
+
private readonly request;
|
|
15
|
+
private _arrayBuffer;
|
|
16
|
+
private _formData;
|
|
17
|
+
private _json;
|
|
18
|
+
private _text;
|
|
19
|
+
constructor(request: Request);
|
|
20
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
21
|
+
formData(): Promise<FormData>;
|
|
22
|
+
json(reviver?: Reviver): Promise<any>;
|
|
23
|
+
text(): Promise<string>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type ExtendedBodyInit = BodyInit | boolean | Date | number | object | null;
|
|
2
|
+
export declare class ResponseBuilder {
|
|
3
|
+
readonly headers: Headers;
|
|
4
|
+
private _status;
|
|
5
|
+
private _explicitStatus;
|
|
6
|
+
private _implicitType;
|
|
7
|
+
private _body;
|
|
8
|
+
private _stringifyBody;
|
|
9
|
+
get status(): number;
|
|
10
|
+
set status(value: number);
|
|
11
|
+
get statusText(): string;
|
|
12
|
+
get body(): ExtendedBodyInit | null;
|
|
13
|
+
set body(value: ExtendedBodyInit | null);
|
|
14
|
+
redirect(url: string | URL): void;
|
|
15
|
+
get type(): string;
|
|
16
|
+
set type(value: string);
|
|
17
|
+
get lastModified(): string | Date | null;
|
|
18
|
+
set lastModified(value: string | Date | null);
|
|
19
|
+
get etag(): string | null;
|
|
20
|
+
set etag(value: string | null);
|
|
21
|
+
create(): Response;
|
|
22
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PathToRegexpOptions } from 'path-to-regexp';
|
|
2
|
+
import { Context } from './context.js';
|
|
3
|
+
import { Middleware } from './middleware.js';
|
|
4
|
+
export type Predicate = (context: Context) => boolean;
|
|
5
|
+
export declare const Method: (method: string) => Predicate;
|
|
6
|
+
export declare const Get: Predicate;
|
|
7
|
+
export declare const Post: Predicate;
|
|
8
|
+
export declare const Put: Predicate;
|
|
9
|
+
export declare const Patch: Predicate;
|
|
10
|
+
export declare const Delete: Predicate;
|
|
11
|
+
export declare const Head: Predicate;
|
|
12
|
+
export declare const Options: Predicate;
|
|
13
|
+
export declare const Header: (header: string, value: string) => Predicate;
|
|
14
|
+
export declare const Host: (host: string) => Predicate;
|
|
15
|
+
export declare const Path: (pattern: string, options?: PathToRegexpOptions) => Predicate;
|
|
16
|
+
export type RouteCondition = (context: Context) => boolean;
|
|
17
|
+
export interface Route {
|
|
18
|
+
conditions: RouteCondition[];
|
|
19
|
+
middleware: Middleware;
|
|
20
|
+
}
|
|
21
|
+
export interface RouterOptions {
|
|
22
|
+
pathToRegExpOptions?: PathToRegexpOptions;
|
|
23
|
+
}
|
|
24
|
+
export declare const defaultRouterOptions: RouterOptions;
|
|
25
|
+
export declare class Router {
|
|
26
|
+
private readonly options;
|
|
27
|
+
private readonly routes;
|
|
28
|
+
constructor(options?: RouterOptions);
|
|
29
|
+
get(pathname: string, ...middleware: Middleware[]): Router;
|
|
30
|
+
post(pathname: string, ...middleware: Middleware[]): Router;
|
|
31
|
+
put(pathname: string, ...middleware: Middleware[]): Router;
|
|
32
|
+
patch(pathname: string, ...middleware: Middleware[]): Router;
|
|
33
|
+
delete(pathname: string, ...middleware: Middleware[]): Router;
|
|
34
|
+
head(pathname: string, ...middleware: Middleware[]): Router;
|
|
35
|
+
all(pathname: string, ...middleware: Middleware[]): Router;
|
|
36
|
+
middleware: Middleware;
|
|
37
|
+
compose(conditions: RouteCondition[], ...middleware: Middleware[]): Router;
|
|
38
|
+
resolve(ctx: Context): Route | undefined;
|
|
39
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OutputUnit, Schema } from '@cfworker/json-schema';
|
|
2
|
+
import { Middleware } from './middleware.js';
|
|
3
|
+
export interface RequestSchemas {
|
|
4
|
+
body?: Schema;
|
|
5
|
+
headers?: Schema;
|
|
6
|
+
params?: Schema;
|
|
7
|
+
search?: Schema;
|
|
8
|
+
}
|
|
9
|
+
export type RequestPart = keyof RequestSchemas;
|
|
10
|
+
export type RequestParser = (data: URLSearchParams | FormData) => any;
|
|
11
|
+
declare function middlewareFactory(schemas: RequestSchemas, parser?: RequestParser, lookup?: Record<string, Schema | boolean>): Middleware;
|
|
12
|
+
export declare const messages: Record<RequestPart, string>;
|
|
13
|
+
export interface RequestValidationErrorBody {
|
|
14
|
+
status: 400;
|
|
15
|
+
part: RequestPart;
|
|
16
|
+
message: string;
|
|
17
|
+
errors: OutputUnit[];
|
|
18
|
+
schema: Schema;
|
|
19
|
+
}
|
|
20
|
+
export declare const validate: typeof middlewareFactory;
|
|
21
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cfworker/web",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"description": "Web framework for Cloudflare Workers and service workers, inspired by Koa and fastify",
|
|
5
|
-
"type": "module",
|
|
6
5
|
"keywords": [
|
|
7
6
|
"middleware",
|
|
8
7
|
"cloudflare",
|
|
@@ -10,62 +9,66 @@
|
|
|
10
9
|
"workers",
|
|
11
10
|
"service-worker"
|
|
12
11
|
],
|
|
12
|
+
"repository": "https://github.com/cfworker/cfworker",
|
|
13
|
+
"author": "Jeremy Danyow <jdanyow@gmail.com>",
|
|
14
|
+
"homepage": "https://github.com/cfworker/cfworker/tree/master/packages/web/README.md",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"type": "module",
|
|
13
20
|
"sideEffects": false,
|
|
14
|
-
"main": "dist/
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"types": "dist/types/index.d.ts",
|
|
21
|
+
"main": "./dist/commonjs/index.js",
|
|
22
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
23
|
+
"module": "./dist/esm/index.js",
|
|
18
24
|
"exports": {
|
|
25
|
+
"./package.json": "./package.json",
|
|
19
26
|
".": {
|
|
20
27
|
"import": {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
28
|
+
"types": "./dist/esm/index.d.ts",
|
|
29
|
+
"default": "./dist/esm/index.js"
|
|
23
30
|
},
|
|
24
31
|
"require": {
|
|
25
|
-
"
|
|
26
|
-
"
|
|
32
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
33
|
+
"default": "./dist/commonjs/index.js"
|
|
27
34
|
}
|
|
28
35
|
}
|
|
29
36
|
},
|
|
30
37
|
"files": [
|
|
31
|
-
"dist
|
|
32
|
-
"src/**/*",
|
|
33
|
-
"README.md",
|
|
34
|
-
"package.json"
|
|
38
|
+
"dist"
|
|
35
39
|
],
|
|
36
|
-
"repository": "https://github.com/cfworker/cfworker",
|
|
37
|
-
"author": "Jeremy Danyow <jdanyow@gmail.com>",
|
|
38
|
-
"homepage": "https://github.com/cfworker/cfworker/tree/master/packages/web/README.md",
|
|
39
|
-
"license": "MIT",
|
|
40
|
-
"publishConfig": {
|
|
41
|
-
"access": "public"
|
|
42
|
-
},
|
|
43
40
|
"scripts": {
|
|
44
|
-
"
|
|
45
|
-
"
|
|
41
|
+
"prepare": "npm run prepare --workspace @cfworker/json-schema && tshy",
|
|
42
|
+
"build": "tsc --build",
|
|
43
|
+
"clean": "tsc --build --clean",
|
|
46
44
|
"pretest": "esbuild test/test.ts --target=esnext --bundle --format=esm --conditions=worker,browser --outdir=dist-test --ignore-annotations",
|
|
47
45
|
"test": "node ../../test.mjs"
|
|
48
46
|
},
|
|
49
47
|
"dependencies": {
|
|
50
|
-
"@cfworker/json-schema": "^4.0.
|
|
51
|
-
"@types/cookie": "^1.0.0",
|
|
48
|
+
"@cfworker/json-schema": "^4.0.3",
|
|
52
49
|
"@types/html-escaper": "^3.0.2",
|
|
53
50
|
"@types/statuses": "^2.0.5",
|
|
54
|
-
"cookie": "^1.0.
|
|
51
|
+
"cookie": "^1.0.2",
|
|
55
52
|
"html-escaper": "^3.0.3",
|
|
56
53
|
"negotiator": "^1.0.0",
|
|
57
54
|
"path-to-regexp": "7.1.0",
|
|
58
|
-
"secure-json-parse": "^
|
|
55
|
+
"secure-json-parse": "^3.0.1",
|
|
59
56
|
"statuses": "^2.0.1"
|
|
60
57
|
},
|
|
61
58
|
"devDependencies": {
|
|
62
59
|
"@types/chai": "^5.0.1",
|
|
63
|
-
"@types/mocha": "^10.0.
|
|
60
|
+
"@types/mocha": "^10.0.10",
|
|
64
61
|
"chai": "^5.1.2",
|
|
65
62
|
"esbuild": "^0.24.0",
|
|
66
63
|
"jsonpointer": "^5.0.1",
|
|
67
|
-
"mocha": "^
|
|
68
|
-
"typescript": "^5.
|
|
69
|
-
"wrangler": "^3.
|
|
64
|
+
"mocha": "^11.0.1",
|
|
65
|
+
"typescript": "^5.7.2",
|
|
66
|
+
"wrangler": "^3.95.0"
|
|
67
|
+
},
|
|
68
|
+
"tshy": {
|
|
69
|
+
"exports": {
|
|
70
|
+
"./package.json": "./package.json",
|
|
71
|
+
".": "./src/index.ts"
|
|
72
|
+
}
|
|
70
73
|
}
|
|
71
74
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.webworker.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/typescript/lib/lib.esnext.string.d.ts","../../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../../node_modules/typescript/lib/lib.esnext.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/accepts.ts","../../../node_modules/@types/statuses/index.d.ts","../../../node_modules/cookie/dist/index.d.ts","../src/cookies.ts","../../../node_modules/secure-json-parse/types/index.d.ts","../src/req.ts","../src/response-builder.ts","../src/context.ts","../src/http-error.ts","../src/middleware.ts","../src/application.ts","../src/declarations.d.ts","../../../node_modules/@types/html-escaper/index.d.ts","../src/normalize-pathname.ts","../../../node_modules/path-to-regexp/dist/index.d.ts","../src/router.ts","../../json-schema/dist/types/deep-compare-strict.d.ts","../../json-schema/dist/types/types.d.ts","../../json-schema/dist/types/dereference.d.ts","../../json-schema/dist/types/format.d.ts","../../json-schema/dist/types/pointer.d.ts","../../json-schema/dist/types/ucs2-length.d.ts","../../json-schema/dist/types/validate.d.ts","../../json-schema/dist/types/validator.d.ts","../../json-schema/dist/types/index.d.ts","../src/validate.ts","../src/index.ts"],"fileIdsList":[[92],[91,92,93,94,95,96,97,98],[76,82,83,84],[78,80,81],[77],[76],[75,78,80,81,82,83,84,85,87,88,90,100],[82],[83,84],[75,79],[82,84,89],[83,84,99]],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"abee51ebffafd50c07d76be5848a34abfe4d791b5745ef1e5648718722fab924","impliedFormat":1},{"version":"30055c4694373918593a99ac50e8bc2d42922b8117f71c79719ee433320eb80c","affectsGlobalScope":true,"impliedFormat":1},{"version":"89dc16e908e1555c5fa1e2f680c793a336996f6095d743d987dc729e04cdad19","affectsGlobalScope":true,"impliedFormat":1},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"45d8ccb3dfd57355eb29749919142d4321a0aa4df6acdfc54e30433d7176600a","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true,"impliedFormat":1},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"1a94697425a99354df73d9c8291e2ecd4dddd370aed4023c2d6dee6cccb32666","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3f9fc0ec0b96a9e642f11eda09c0be83a61c7b336977f8b9fdb1e9788e925fe","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true,"impliedFormat":1},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true,"impliedFormat":1},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true,"impliedFormat":1},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true,"impliedFormat":1},{"version":"15c1c3d7b2e46e0025417ed6d5f03f419e57e6751f87925ca19dc88297053fe6","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"9d540251809289a05349b70ab5f4b7b99f922af66ab3c39ba56a475dcf95d5ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"0b11f3ca66aa33124202c80b70cd203219c3d4460cfc165e0707aa9ec710fc53","affectsGlobalScope":true,"impliedFormat":1},{"version":"6a3f5a0129cc80cf439ab71164334d649b47059a4f5afca90282362407d0c87f","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"95843649a529090b4fdc5d67217978d74c8dab4717f3a5f5df3548265af7a160","signature":"69bb8b89892892fa35ccbe23bceb035223c62e095a48ccca757f0097647e552d"},{"version":"1f4ae755492a669b317903a6b1664cb7af3fe0c3d1eec6447f4e95a80616d15a","impliedFormat":1},{"version":"5a7ebcf5fe8ac590dd03af1bbe426dfed639a3490fb1e5d6b934e45643b8ea1b","impliedFormat":1},{"version":"84e027494cf86685ae97580a9f3dafe0940e88d7d8b81f2e48756b0f04cc9b23","signature":"008a7d5260b44c821334fae939b1ad4dd96024a649fbec96725a819d497697d7"},{"version":"453740a49328721fb8cb3ee3a8422eab92f78fab88f31b79508a801634fec1e2","impliedFormat":1},{"version":"b2c8a481cfc150d85ea00831d3fdf4aaed77008ae7b4b4207276b08e267f7624","signature":"6e05f2be5d58e5f8d94c62f4013f7d0533dbaec53d1deff9c383c4406f011084"},{"version":"b60928670b1755f3e102c189619ea2e9e2237ecb40e010c52480bf26840b741a","signature":"c4c84dffaa3f00b75f89dbc3eb8f31a752383436b039264f42df063bdad679cf"},{"version":"a5536381b154ed8bc3a4f39b1bdb815bcec1be1e4886607b52486f589b2fa5c5","signature":"e9eb86a27ee96f3a99aa5631f8b6de3848cd351f721f58032cf6d7ed864a78b6"},{"version":"2a1f08253ff84ee25efd34d7948dd0c73a5ecefc86bb9958b537153bb86f061a","signature":"5241793d5d6e0ef3537b74cdec0c0c49fa171885f220e0497ea9801c85141936"},{"version":"1c04e253c9e3c14ac5cbc81572a6e36f132deaf90c4a069d8cfa5affa7205277","signature":"cd00628b29ccca0cbde6bf22559a0d5e7210520f8bb45a5e1dcbaa8a2da80e7f"},{"version":"90bb8934ea69c1a1dbe83b55efbc8a7793484b6ec4ff14c25c4104ce12515f08","signature":"3532abc970b751a18a40eabdaa29e837ca9e6ae8b37929fc6022be1e3e064af1"},{"version":"b8ff6faf6bf647032e3cee5f7e4b2e0f2e668f930d6e5beb894cfee4c6c26936","affectsGlobalScope":true},{"version":"2cbbade4eaf0c1e4718ad4961979488f0fb74c38392d7cf705358950e913943d","impliedFormat":1},{"version":"c7fb7af1dbdfb292379b22678566bc719dedee6888741cbcdb3f4f05bd1fb82c","signature":"834bee2451101fde1d9f0062068488cfba4c9bd843b9fef4b2b0f0a315954024"},{"version":"02dfc937dce0da28fe4bc500a32b7d645acedd00609a762a5426feebb575431b","impliedFormat":1},{"version":"0bdde4a7d52679acdc6d463212cf7ff6a9d1d3ac566f0d7edf9ecc829d1d9223","signature":"7e135c8a81e6a046ee90e6afa1b74a6c18c8076e7dfe2080f46125eddb9f4d73"},"61d6c43861d171f1129a3179983d8af80995d3e86f90bdeaad9415756022d4b3","33bb7966e2c859326207e0bda17423fbf1bd81dbc8e6ba54fa143f950566e9da","4ae63b19255579a897918c94e928c4351c6bb6de552d50f14f41c6f175f4d282","4114c8edf09acaa907aa1293c6fbfc71d26b7ae9ecf0e3dbf4ec47302bc51444","4276e358bf27203613ebe2f917706385875fa02481ed2829a96611eecc8c4255","c223c62757304681e71494f26e78e828c83f9612b76c1181b2e9a7cf6f853fec","d0f4d6c857e665d4163074039b1fbd996d67b8ef233117412adf4748b33689f5","e25f0e3f148d4fb60ad91dc4ac77886119d2ff74f408596477c62f7bda54cb9b","a204e4f8f148eacfce004a47fb7920ffce1e7744323c2018731d288bf805c590",{"version":"9e97a42f468e93a544cbb6af8b73ecd2894f7b18ea07c89b5feadc983d23c832","signature":"6b01ba5f8086cd87ab8047414f6eec54a9fe8aafb620f0f31daf7f8ae44ddc8c"},"be3c1a1c10970723dca8fda3f3d3e47fbac3ead8fd347e47f726ad257141420b"],"root":[75,78,[80,86],88,90,100,101],"options":{"composite":true,"declarationDir":"./types","esModuleInterop":true,"isolatedDeclarations":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./cjs","removeComments":true,"rootDir":"../src","strict":true,"target":99},"referencedMap":[[93,1],[99,2],[97,1],[98,1],[85,3],[82,4],[78,5],[83,6],[101,7],[84,8],[88,9],[80,10],[81,6],[90,11],[100,12]],"latestChangedDtsFile":"./types/index.d.ts","version":"5.6.3"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/typescript/lib/lib.webworker.d.ts","../../../node_modules/typescript/lib/lib.webworker.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/typescript/lib/lib.esnext.string.d.ts","../../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../../node_modules/typescript/lib/lib.esnext.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/accepts.ts","../../../node_modules/@types/statuses/index.d.ts","../../../node_modules/cookie/dist/index.d.ts","../src/cookies.ts","../../../node_modules/secure-json-parse/types/index.d.ts","../src/req.ts","../src/response-builder.ts","../src/context.ts","../src/http-error.ts","../src/middleware.ts","../src/application.ts","../src/declarations.d.ts","../../../node_modules/@types/html-escaper/index.d.ts","../src/normalize-pathname.ts","../../../node_modules/path-to-regexp/dist/index.d.ts","../src/router.ts","../../json-schema/dist/types/deep-compare-strict.d.ts","../../json-schema/dist/types/types.d.ts","../../json-schema/dist/types/dereference.d.ts","../../json-schema/dist/types/format.d.ts","../../json-schema/dist/types/pointer.d.ts","../../json-schema/dist/types/ucs2-length.d.ts","../../json-schema/dist/types/validate.d.ts","../../json-schema/dist/types/validator.d.ts","../../json-schema/dist/types/index.d.ts","../src/validate.ts","../src/index.ts"],"fileIdsList":[[92],[91,92,93,94,95,96,97,98],[76,82,83,84],[78,80,81],[77],[76],[75,78,80,81,82,83,84,85,87,88,90,100],[82],[83,84],[75,79],[82,84,89],[83,84,99]],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"abee51ebffafd50c07d76be5848a34abfe4d791b5745ef1e5648718722fab924","impliedFormat":1},{"version":"30055c4694373918593a99ac50e8bc2d42922b8117f71c79719ee433320eb80c","affectsGlobalScope":true,"impliedFormat":1},{"version":"89dc16e908e1555c5fa1e2f680c793a336996f6095d743d987dc729e04cdad19","affectsGlobalScope":true,"impliedFormat":1},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"45d8ccb3dfd57355eb29749919142d4321a0aa4df6acdfc54e30433d7176600a","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true,"impliedFormat":1},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"1a94697425a99354df73d9c8291e2ecd4dddd370aed4023c2d6dee6cccb32666","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3f9fc0ec0b96a9e642f11eda09c0be83a61c7b336977f8b9fdb1e9788e925fe","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true,"impliedFormat":1},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true,"impliedFormat":1},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true,"impliedFormat":1},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true,"impliedFormat":1},{"version":"15c1c3d7b2e46e0025417ed6d5f03f419e57e6751f87925ca19dc88297053fe6","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"9d540251809289a05349b70ab5f4b7b99f922af66ab3c39ba56a475dcf95d5ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"0b11f3ca66aa33124202c80b70cd203219c3d4460cfc165e0707aa9ec710fc53","affectsGlobalScope":true,"impliedFormat":1},{"version":"6a3f5a0129cc80cf439ab71164334d649b47059a4f5afca90282362407d0c87f","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"95843649a529090b4fdc5d67217978d74c8dab4717f3a5f5df3548265af7a160","signature":"69bb8b89892892fa35ccbe23bceb035223c62e095a48ccca757f0097647e552d"},{"version":"1f4ae755492a669b317903a6b1664cb7af3fe0c3d1eec6447f4e95a80616d15a","impliedFormat":1},{"version":"5a7ebcf5fe8ac590dd03af1bbe426dfed639a3490fb1e5d6b934e45643b8ea1b","impliedFormat":1},{"version":"84e027494cf86685ae97580a9f3dafe0940e88d7d8b81f2e48756b0f04cc9b23","signature":"008a7d5260b44c821334fae939b1ad4dd96024a649fbec96725a819d497697d7"},{"version":"453740a49328721fb8cb3ee3a8422eab92f78fab88f31b79508a801634fec1e2","impliedFormat":1},{"version":"b2c8a481cfc150d85ea00831d3fdf4aaed77008ae7b4b4207276b08e267f7624","signature":"6e05f2be5d58e5f8d94c62f4013f7d0533dbaec53d1deff9c383c4406f011084"},{"version":"b60928670b1755f3e102c189619ea2e9e2237ecb40e010c52480bf26840b741a","signature":"c4c84dffaa3f00b75f89dbc3eb8f31a752383436b039264f42df063bdad679cf"},{"version":"a5536381b154ed8bc3a4f39b1bdb815bcec1be1e4886607b52486f589b2fa5c5","signature":"e9eb86a27ee96f3a99aa5631f8b6de3848cd351f721f58032cf6d7ed864a78b6"},{"version":"2a1f08253ff84ee25efd34d7948dd0c73a5ecefc86bb9958b537153bb86f061a","signature":"5241793d5d6e0ef3537b74cdec0c0c49fa171885f220e0497ea9801c85141936"},{"version":"1c04e253c9e3c14ac5cbc81572a6e36f132deaf90c4a069d8cfa5affa7205277","signature":"cd00628b29ccca0cbde6bf22559a0d5e7210520f8bb45a5e1dcbaa8a2da80e7f"},{"version":"90bb8934ea69c1a1dbe83b55efbc8a7793484b6ec4ff14c25c4104ce12515f08","signature":"3532abc970b751a18a40eabdaa29e837ca9e6ae8b37929fc6022be1e3e064af1"},{"version":"b8ff6faf6bf647032e3cee5f7e4b2e0f2e668f930d6e5beb894cfee4c6c26936","affectsGlobalScope":true},{"version":"2cbbade4eaf0c1e4718ad4961979488f0fb74c38392d7cf705358950e913943d","impliedFormat":1},{"version":"c7fb7af1dbdfb292379b22678566bc719dedee6888741cbcdb3f4f05bd1fb82c","signature":"834bee2451101fde1d9f0062068488cfba4c9bd843b9fef4b2b0f0a315954024"},{"version":"02dfc937dce0da28fe4bc500a32b7d645acedd00609a762a5426feebb575431b","impliedFormat":1},{"version":"0bdde4a7d52679acdc6d463212cf7ff6a9d1d3ac566f0d7edf9ecc829d1d9223","signature":"7e135c8a81e6a046ee90e6afa1b74a6c18c8076e7dfe2080f46125eddb9f4d73"},"61d6c43861d171f1129a3179983d8af80995d3e86f90bdeaad9415756022d4b3","33bb7966e2c859326207e0bda17423fbf1bd81dbc8e6ba54fa143f950566e9da","4ae63b19255579a897918c94e928c4351c6bb6de552d50f14f41c6f175f4d282","4114c8edf09acaa907aa1293c6fbfc71d26b7ae9ecf0e3dbf4ec47302bc51444","4276e358bf27203613ebe2f917706385875fa02481ed2829a96611eecc8c4255","c223c62757304681e71494f26e78e828c83f9612b76c1181b2e9a7cf6f853fec","d0f4d6c857e665d4163074039b1fbd996d67b8ef233117412adf4748b33689f5","e25f0e3f148d4fb60ad91dc4ac77886119d2ff74f408596477c62f7bda54cb9b","a204e4f8f148eacfce004a47fb7920ffce1e7744323c2018731d288bf805c590",{"version":"9e97a42f468e93a544cbb6af8b73ecd2894f7b18ea07c89b5feadc983d23c832","signature":"6b01ba5f8086cd87ab8047414f6eec54a9fe8aafb620f0f31daf7f8ae44ddc8c"},"be3c1a1c10970723dca8fda3f3d3e47fbac3ead8fd347e47f726ad257141420b"],"root":[75,78,[80,86],88,90,100,101],"options":{"composite":true,"declarationDir":"./types","esModuleInterop":true,"isolatedDeclarations":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./esm","removeComments":true,"rootDir":"../src","strict":true,"target":99},"referencedMap":[[93,1],[99,2],[97,1],[98,1],[85,3],[82,4],[78,5],[83,6],[101,7],[84,8],[88,9],[80,10],[81,6],[90,11],[100,12]],"latestChangedDtsFile":"./types/index.d.ts","version":"5.6.3"}
|
package/src/accepts.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import { preferredCharsets } from 'negotiator/lib/charset.js';
|
|
3
|
-
// @ts-ignore
|
|
4
|
-
import { preferredEncodings } from 'negotiator/lib/encoding.js';
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
import { preferredLanguages } from 'negotiator/lib/language.js';
|
|
7
|
-
// @ts-ignore
|
|
8
|
-
import { preferredMediaTypes } from 'negotiator/lib/mediaType.js';
|
|
9
|
-
|
|
10
|
-
const parseAccept = preferredMediaTypes as (header: string) => string[];
|
|
11
|
-
const parseAcceptLanguage = preferredLanguages as (header: string) => string[];
|
|
12
|
-
const parseAcceptEncoding = preferredEncodings as (header: string) => string[];
|
|
13
|
-
const parseAcceptCharset = preferredCharsets as (header: string) => string[];
|
|
14
|
-
|
|
15
|
-
export class Accepts {
|
|
16
|
-
private _type: string[] | undefined = undefined;
|
|
17
|
-
private _language: string[] | undefined = undefined;
|
|
18
|
-
private _encoding: string[] | undefined = undefined;
|
|
19
|
-
private _charset: string[] | undefined = undefined;
|
|
20
|
-
|
|
21
|
-
constructor(private readonly headers: Headers) {}
|
|
22
|
-
|
|
23
|
-
public type<T extends string>(...values: T[]): T | false {
|
|
24
|
-
if (!this._type) {
|
|
25
|
-
const header = this.headers.get('accept');
|
|
26
|
-
this._type = header ? parseAccept(header.toLowerCase()) : [];
|
|
27
|
-
}
|
|
28
|
-
for (const accepted of this._type) {
|
|
29
|
-
for (const value of values) {
|
|
30
|
-
if (
|
|
31
|
-
value === accepted ||
|
|
32
|
-
(accepted.startsWith('*') && value.endsWith(accepted.substr(1))) ||
|
|
33
|
-
(accepted.endsWith('*') &&
|
|
34
|
-
value.startsWith(accepted.substr(0, accepted.length - 2)))
|
|
35
|
-
) {
|
|
36
|
-
return value;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
public language<T extends string>(...values: T[]): T | false {
|
|
44
|
-
if (!this._language) {
|
|
45
|
-
const header = this.headers.get('accept-language');
|
|
46
|
-
this._language = header ? parseAcceptLanguage(header.toLowerCase()) : [];
|
|
47
|
-
}
|
|
48
|
-
for (const accepted of this._language) {
|
|
49
|
-
for (const value of values) {
|
|
50
|
-
if (value === accepted || value.startsWith(accepted)) {
|
|
51
|
-
return value;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public encoding<T extends string>(...values: T[]): T | false {
|
|
59
|
-
if (!this._encoding) {
|
|
60
|
-
const header = this.headers.get('accept-encoding');
|
|
61
|
-
this._encoding = header ? parseAcceptEncoding(header.toLowerCase()) : [];
|
|
62
|
-
}
|
|
63
|
-
for (const accepted of this._encoding) {
|
|
64
|
-
for (const value of values) {
|
|
65
|
-
if (value === accepted) {
|
|
66
|
-
return value;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
public charset<T extends string>(...values: T[]): T | false {
|
|
74
|
-
if (!this._charset) {
|
|
75
|
-
const header = this.headers.get('accept-charset');
|
|
76
|
-
this._charset = header ? parseAcceptCharset(header.toLowerCase()) : [];
|
|
77
|
-
}
|
|
78
|
-
for (const accepted of this._charset) {
|
|
79
|
-
for (const value of values) {
|
|
80
|
-
if (value === accepted) {
|
|
81
|
-
return value;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
}
|
package/src/application.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import statuses from 'statuses';
|
|
2
|
-
import { Context } from './context.js';
|
|
3
|
-
import { HttpError } from './http-error.js';
|
|
4
|
-
import { composeMiddleware, Middleware } from './middleware.js';
|
|
5
|
-
|
|
6
|
-
const resolved = Promise.resolve();
|
|
7
|
-
|
|
8
|
-
export class Application {
|
|
9
|
-
private readonly middleware: Middleware[] = [];
|
|
10
|
-
private _composedMiddleware?: Middleware;
|
|
11
|
-
|
|
12
|
-
private get composedMiddleware() {
|
|
13
|
-
if (!this._composedMiddleware) {
|
|
14
|
-
this._composedMiddleware = composeMiddleware(this.middleware);
|
|
15
|
-
}
|
|
16
|
-
return this._composedMiddleware;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
public use(middleware: Middleware): Application {
|
|
20
|
-
this.middleware.push(middleware);
|
|
21
|
-
this._composedMiddleware = undefined;
|
|
22
|
-
return this;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public async handleRequest(
|
|
26
|
-
request: Request,
|
|
27
|
-
env: any,
|
|
28
|
-
context: {
|
|
29
|
-
waitUntil(promise: Promise<any>): void;
|
|
30
|
-
}
|
|
31
|
-
): Promise<Response> {
|
|
32
|
-
return this.invokeMiddleware(
|
|
33
|
-
new Context(request, env, context),
|
|
34
|
-
this.composedMiddleware
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
private async invokeMiddleware(context: Context, middleware: Middleware) {
|
|
39
|
-
try {
|
|
40
|
-
await middleware(context, () => resolved);
|
|
41
|
-
return context.res.create();
|
|
42
|
-
} catch (err) {
|
|
43
|
-
console.error((err as any)?.stack ?? err);
|
|
44
|
-
|
|
45
|
-
if (err instanceof HttpError) {
|
|
46
|
-
return err.toResponse();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const status = 500;
|
|
50
|
-
const statusText = statuses.message[500];
|
|
51
|
-
const headers = { 'content-type': 'text/plain' };
|
|
52
|
-
return new Response(statusText, { status, statusText, headers });
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
package/src/context.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Cookies } from './cookies.js';
|
|
2
|
-
import { Req } from './req.js';
|
|
3
|
-
import { ResponseBuilder } from './response-builder.js';
|
|
4
|
-
|
|
5
|
-
export class Context {
|
|
6
|
-
public readonly req: Req;
|
|
7
|
-
public readonly res: ResponseBuilder;
|
|
8
|
-
public readonly cookies: Cookies;
|
|
9
|
-
public readonly state: any;
|
|
10
|
-
|
|
11
|
-
constructor(
|
|
12
|
-
request: Request,
|
|
13
|
-
public readonly environmentBindings: any,
|
|
14
|
-
private readonly _context: {
|
|
15
|
-
waitUntil(promise: Promise<any>): void;
|
|
16
|
-
}
|
|
17
|
-
) {
|
|
18
|
-
this.req = new Req(request);
|
|
19
|
-
this.res = new ResponseBuilder();
|
|
20
|
-
this.cookies = new Cookies(request.headers, this.res.headers);
|
|
21
|
-
this.state = {};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
public waitUntil(promise: Promise<any>): void {
|
|
25
|
-
this._context.waitUntil(promise);
|
|
26
|
-
}
|
|
27
|
-
}
|