@carno.js/core 0.2.11 → 1.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/LICENSE +673 -673
- package/README.md +188 -0
- package/dist/Carno.js +272 -333
- package/dist/Carno.mjs +268 -0
- package/dist/DefaultRoutes.js +51 -0
- package/dist/DefaultRoutes.mjs +34 -0
- package/dist/bun/index.js +183 -0
- package/dist/bun/index.js.map +86 -0
- package/dist/cache/CacheDriver.js +13 -0
- package/dist/cache/CacheDriver.mjs +0 -0
- package/dist/cache/CacheService.js +113 -0
- package/dist/cache/CacheService.mjs +93 -0
- package/dist/cache/MemoryDriver.js +66 -0
- package/dist/cache/MemoryDriver.mjs +46 -0
- package/dist/cache/RedisDriver.js +81 -0
- package/dist/cache/RedisDriver.mjs +61 -0
- package/dist/compiler/JITCompiler.js +111 -0
- package/dist/compiler/JITCompiler.mjs +89 -0
- package/dist/container/Container.js +99 -0
- package/dist/container/Container.mjs +78 -0
- package/dist/context/Context.js +97 -0
- package/dist/context/Context.mjs +77 -0
- package/dist/cors/CorsHandler.js +90 -0
- package/dist/cors/CorsHandler.mjs +68 -0
- package/dist/decorators/Controller.js +42 -0
- package/dist/decorators/Controller.mjs +22 -0
- package/dist/decorators/Inject.js +30 -0
- package/dist/decorators/Inject.mjs +10 -0
- package/dist/decorators/Middleware.js +35 -0
- package/dist/decorators/Middleware.mjs +15 -0
- package/dist/decorators/Service.js +31 -0
- package/dist/decorators/Service.mjs +12 -0
- package/dist/decorators/methods.js +60 -0
- package/dist/decorators/methods.mjs +34 -0
- package/dist/decorators/params.js +63 -0
- package/dist/decorators/params.mjs +37 -0
- package/dist/events/Lifecycle.js +69 -0
- package/dist/events/Lifecycle.mjs +41 -0
- package/dist/exceptions/HttpException.js +112 -26
- package/dist/exceptions/HttpException.mjs +82 -0
- package/dist/index.js +129 -31
- package/dist/index.mjs +94 -0
- package/dist/metadata.js +34 -0
- package/dist/metadata.mjs +9 -0
- package/dist/middleware/CarnoMiddleware.js +13 -0
- package/dist/middleware/CarnoMiddleware.mjs +0 -0
- package/dist/router/RadixRouter.js +121 -0
- package/dist/router/RadixRouter.mjs +101 -0
- package/dist/testing/TestHarness.js +81 -0
- package/dist/testing/TestHarness.mjs +60 -0
- package/dist/utils/Metadata.js +53 -0
- package/dist/utils/Metadata.mjs +31 -0
- package/dist/validation/ValibotAdapter.js +67 -0
- package/dist/validation/ValibotAdapter.mjs +48 -0
- package/dist/validation/ValidatorAdapter.js +35 -19
- package/dist/validation/ValidatorAdapter.mjs +14 -0
- package/dist/validation/ZodAdapter.js +80 -0
- package/dist/validation/ZodAdapter.mjs +59 -0
- package/package.json +21 -63
- package/src/Carno.ts +605 -0
- package/src/DefaultRoutes.ts +34 -0
- package/src/cache/CacheDriver.ts +50 -0
- package/src/cache/CacheService.ts +139 -0
- package/src/cache/MemoryDriver.ts +104 -0
- package/src/cache/RedisDriver.ts +116 -0
- package/src/compiler/JITCompiler.ts +167 -0
- package/src/container/Container.ts +168 -0
- package/src/context/Context.ts +128 -0
- package/src/cors/CorsHandler.ts +145 -0
- package/src/decorators/Controller.ts +63 -0
- package/src/decorators/Inject.ts +16 -0
- package/src/decorators/Middleware.ts +22 -0
- package/src/decorators/Service.ts +18 -0
- package/src/decorators/methods.ts +58 -0
- package/src/decorators/params.ts +47 -0
- package/src/events/Lifecycle.ts +97 -0
- package/src/exceptions/HttpException.ts +99 -0
- package/src/index.ts +92 -0
- package/src/metadata.ts +46 -0
- package/src/middleware/CarnoMiddleware.ts +14 -0
- package/src/router/RadixRouter.ts +225 -0
- package/src/testing/TestHarness.ts +177 -0
- package/src/utils/Metadata.ts +43 -0
- package/src/validation/ValibotAdapter.ts +95 -0
- package/src/validation/ValidatorAdapter.ts +69 -0
- package/src/validation/ZodAdapter.ts +102 -0
- package/dist/Carno.d.ts +0 -75
- package/dist/cache/bento-cache.driver.d.ts +0 -13
- package/dist/cache/bento-cache.driver.js +0 -55
- package/dist/cache/cache.service.d.ts +0 -8
- package/dist/cache/cache.service.js +0 -6
- package/dist/commons/decorators/Injectable.decorator.d.ts +0 -20
- package/dist/commons/decorators/Injectable.decorator.js +0 -33
- package/dist/commons/decorators/controller.decorator.d.ts +0 -8
- package/dist/commons/decorators/controller.decorator.js +0 -22
- package/dist/commons/decorators/http.decorators.d.ts +0 -13
- package/dist/commons/decorators/http.decorators.js +0 -63
- package/dist/commons/decorators/index.d.ts +0 -6
- package/dist/commons/decorators/index.js +0 -22
- package/dist/commons/decorators/inject.decorator.d.ts +0 -1
- package/dist/commons/decorators/inject.decorator.js +0 -5
- package/dist/commons/decorators/middleware.decorator.d.ts +0 -2
- package/dist/commons/decorators/middleware.decorator.js +0 -30
- package/dist/commons/decorators/service.decorator.d.ts +0 -2
- package/dist/commons/decorators/service.decorator.js +0 -7
- package/dist/commons/decorators/validation.decorator.d.ts +0 -32
- package/dist/commons/decorators/validation.decorator.js +0 -40
- package/dist/commons/http-code.enum.d.ts +0 -50
- package/dist/commons/http-code.enum.js +0 -54
- package/dist/commons/index.d.ts +0 -3
- package/dist/commons/index.js +0 -19
- package/dist/commons/registries/ProviderControl.d.ts +0 -77
- package/dist/commons/registries/ProviderControl.js +0 -112
- package/dist/commons/registries/ProviderRegistry.d.ts +0 -7
- package/dist/commons/registries/ProviderRegistry.js +0 -20
- package/dist/constants.d.ts +0 -8
- package/dist/constants.js +0 -11
- package/dist/container/ContainerConfiguration.d.ts +0 -45
- package/dist/container/ContainerConfiguration.js +0 -121
- package/dist/container/DependencyResolver.d.ts +0 -20
- package/dist/container/DependencyResolver.js +0 -85
- package/dist/container/InjectorService.d.ts +0 -58
- package/dist/container/InjectorService.js +0 -286
- package/dist/container/MethodInvoker.d.ts +0 -21
- package/dist/container/MethodInvoker.js +0 -83
- package/dist/container/RouteResolver.d.ts +0 -27
- package/dist/container/RouteResolver.js +0 -173
- package/dist/container/container.d.ts +0 -41
- package/dist/container/container.js +0 -71
- package/dist/container/createContainer.d.ts +0 -3
- package/dist/container/createContainer.js +0 -12
- package/dist/container/createInjector.d.ts +0 -2
- package/dist/container/createInjector.js +0 -7
- package/dist/container/index.d.ts +0 -6
- package/dist/container/index.js +0 -22
- package/dist/container/middleware.resolver.d.ts +0 -9
- package/dist/container/middleware.resolver.js +0 -35
- package/dist/default-routes-carno.d.ts +0 -3
- package/dist/default-routes-carno.js +0 -29
- package/dist/domain/BaseContext.d.ts +0 -15
- package/dist/domain/BaseContext.js +0 -2
- package/dist/domain/CarnoClosure.d.ts +0 -1
- package/dist/domain/CarnoClosure.js +0 -2
- package/dist/domain/CarnoMiddleware.d.ts +0 -5
- package/dist/domain/CarnoMiddleware.js +0 -2
- package/dist/domain/Context.d.ts +0 -58
- package/dist/domain/Context.js +0 -188
- package/dist/domain/FastContext.d.ts +0 -34
- package/dist/domain/FastContext.js +0 -59
- package/dist/domain/LocalsContainer.d.ts +0 -4
- package/dist/domain/LocalsContainer.js +0 -10
- package/dist/domain/Metadata.d.ts +0 -449
- package/dist/domain/Metadata.js +0 -511
- package/dist/domain/cors-config.d.ts +0 -12
- package/dist/domain/cors-config.js +0 -18
- package/dist/domain/cors-headers-cache.d.ts +0 -17
- package/dist/domain/cors-headers-cache.js +0 -101
- package/dist/domain/http-method.d.ts +0 -7
- package/dist/domain/http-method.js +0 -11
- package/dist/domain/index.d.ts +0 -10
- package/dist/domain/index.js +0 -26
- package/dist/domain/provider-scope.d.ts +0 -5
- package/dist/domain/provider-scope.js +0 -9
- package/dist/domain/provider-type.d.ts +0 -6
- package/dist/domain/provider-type.js +0 -10
- package/dist/domain/provider.d.ts +0 -37
- package/dist/domain/provider.js +0 -70
- package/dist/events/hooks.decorator.d.ts +0 -3
- package/dist/events/hooks.decorator.js +0 -29
- package/dist/events/index.d.ts +0 -2
- package/dist/events/index.js +0 -18
- package/dist/events/on-event.d.ts +0 -13
- package/dist/events/on-event.js +0 -11
- package/dist/exceptions/HttpException.d.ts +0 -9
- package/dist/exceptions/index.d.ts +0 -1
- package/dist/exceptions/index.js +0 -17
- package/dist/index.d.ts +0 -16
- package/dist/route/CompiledRoute.d.ts +0 -23
- package/dist/route/CompiledRoute.js +0 -9
- package/dist/route/FastPathExecutor.d.ts +0 -12
- package/dist/route/FastPathExecutor.js +0 -50
- package/dist/route/JITCompiler.d.ts +0 -28
- package/dist/route/JITCompiler.js +0 -245
- package/dist/route/Matcher.d.ts +0 -11
- package/dist/route/Matcher.js +0 -48
- package/dist/route/ParamResolverFactory.d.ts +0 -14
- package/dist/route/ParamResolverFactory.js +0 -49
- package/dist/route/RouteCompiler.d.ts +0 -28
- package/dist/route/RouteCompiler.js +0 -157
- package/dist/route/RouteExecutor.d.ts +0 -12
- package/dist/route/RouteExecutor.js +0 -84
- package/dist/route/memoirist.d.ts +0 -31
- package/dist/route/memoirist.js +0 -373
- package/dist/services/logger.service.d.ts +0 -23
- package/dist/services/logger.service.js +0 -47
- package/dist/testing/core-testing.d.ts +0 -24
- package/dist/testing/core-testing.js +0 -102
- package/dist/testing/index.d.ts +0 -1
- package/dist/testing/index.js +0 -17
- package/dist/utils/ValidationCache.d.ts +0 -5
- package/dist/utils/ValidationCache.js +0 -35
- package/dist/utils/ancestorOf.d.ts +0 -2
- package/dist/utils/ancestorOf.js +0 -10
- package/dist/utils/ancestorsOf.d.ts +0 -6
- package/dist/utils/ancestorsOf.js +0 -20
- package/dist/utils/classOf.d.ts +0 -13
- package/dist/utils/classOf.js +0 -21
- package/dist/utils/cleanObject.d.ts +0 -6
- package/dist/utils/cleanObject.js +0 -22
- package/dist/utils/constructorOf.d.ts +0 -11
- package/dist/utils/constructorOf.js +0 -18
- package/dist/utils/createInstance.d.ts +0 -1
- package/dist/utils/createInstance.js +0 -7
- package/dist/utils/decoratorTypeOf.d.ts +0 -11
- package/dist/utils/decoratorTypeOf.js +0 -32
- package/dist/utils/deepClone.d.ts +0 -6
- package/dist/utils/deepClone.js +0 -63
- package/dist/utils/deepMerge.d.ts +0 -9
- package/dist/utils/deepMerge.js +0 -62
- package/dist/utils/descriptorOf.d.ts +0 -8
- package/dist/utils/descriptorOf.js +0 -16
- package/dist/utils/formatValidationErrors.d.ts +0 -5
- package/dist/utils/formatValidationErrors.js +0 -80
- package/dist/utils/getClassOrSymbol.d.ts +0 -1
- package/dist/utils/getClassOrSymbol.js +0 -8
- package/dist/utils/getConstructorArgNames.d.ts +0 -1
- package/dist/utils/getConstructorArgNames.js +0 -12
- package/dist/utils/getMethodArgTypes.d.ts +0 -1
- package/dist/utils/getMethodArgTypes.js +0 -9
- package/dist/utils/getValue.d.ts +0 -32
- package/dist/utils/getValue.js +0 -47
- package/dist/utils/hasJsonMethod.d.ts +0 -1
- package/dist/utils/hasJsonMethod.js +0 -6
- package/dist/utils/index.d.ts +0 -15
- package/dist/utils/index.js +0 -31
- package/dist/utils/isArray.d.ts +0 -13
- package/dist/utils/isArray.js +0 -21
- package/dist/utils/isArrowFn.d.ts +0 -1
- package/dist/utils/isArrowFn.js +0 -7
- package/dist/utils/isBoolean.d.ts +0 -7
- package/dist/utils/isBoolean.js +0 -15
- package/dist/utils/isBuffer.d.ts +0 -7
- package/dist/utils/isBuffer.js +0 -19
- package/dist/utils/isClass.d.ts +0 -1
- package/dist/utils/isClass.js +0 -26
- package/dist/utils/isCollection.d.ts +0 -6
- package/dist/utils/isCollection.js +0 -20
- package/dist/utils/isDate.d.ts +0 -6
- package/dist/utils/isDate.js +0 -11
- package/dist/utils/isEmpty.d.ts +0 -6
- package/dist/utils/isEmpty.js +0 -12
- package/dist/utils/isFunction.d.ts +0 -1
- package/dist/utils/isFunction.js +0 -6
- package/dist/utils/isInheritedFrom.d.ts +0 -1
- package/dist/utils/isInheritedFrom.js +0 -24
- package/dist/utils/isMomentObject.d.ts +0 -1
- package/dist/utils/isMomentObject.js +0 -6
- package/dist/utils/isMongooseObject.d.ts +0 -2
- package/dist/utils/isMongooseObject.js +0 -11
- package/dist/utils/isNil.d.ts +0 -1
- package/dist/utils/isNil.js +0 -6
- package/dist/utils/isNumber.d.ts +0 -7
- package/dist/utils/isNumber.js +0 -15
- package/dist/utils/isObject.d.ts +0 -1
- package/dist/utils/isObject.js +0 -6
- package/dist/utils/isObservable.d.ts +0 -1
- package/dist/utils/isObservable.js +0 -6
- package/dist/utils/isPlainObject.d.ts +0 -7
- package/dist/utils/isPlainObject.js +0 -16
- package/dist/utils/isPrimitive.d.ts +0 -14
- package/dist/utils/isPrimitive.js +0 -28
- package/dist/utils/isPrimitiveType.d.ts +0 -1
- package/dist/utils/isPrimitiveType.js +0 -11
- package/dist/utils/isPromise.d.ts +0 -7
- package/dist/utils/isPromise.js +0 -14
- package/dist/utils/isProtectedKey.d.ts +0 -5
- package/dist/utils/isProtectedKey.js +0 -10
- package/dist/utils/isRegExp.d.ts +0 -1
- package/dist/utils/isRegExp.js +0 -6
- package/dist/utils/isRequestScope.d.ts +0 -11
- package/dist/utils/isRequestScope.js +0 -23
- package/dist/utils/isSerializable.d.ts +0 -1
- package/dist/utils/isSerializable.js +0 -11
- package/dist/utils/isStream.d.ts +0 -1
- package/dist/utils/isStream.js +0 -6
- package/dist/utils/isString.d.ts +0 -6
- package/dist/utils/isString.js +0 -14
- package/dist/utils/isSymbol.d.ts +0 -6
- package/dist/utils/isSymbol.js +0 -14
- package/dist/utils/methodsOf.d.ts +0 -9
- package/dist/utils/methodsOf.js +0 -24
- package/dist/utils/nameOf.d.ts +0 -14
- package/dist/utils/nameOf.js +0 -31
- package/dist/utils/objectKeys.d.ts +0 -1
- package/dist/utils/objectKeys.js +0 -7
- package/dist/utils/primitiveOf.d.ts +0 -1
- package/dist/utils/primitiveOf.js +0 -18
- package/dist/utils/prototypeOf.d.ts +0 -6
- package/dist/utils/prototypeOf.js +0 -12
- package/dist/utils/setValue.d.ts +0 -1
- package/dist/utils/setValue.js +0 -32
- package/dist/utils/toMap.d.ts +0 -3
- package/dist/utils/toMap.js +0 -34
- package/dist/utils/toStringConstructor.d.ts +0 -1
- package/dist/utils/toStringConstructor.js +0 -10
- package/dist/validation/ValidatorAdapter.d.ts +0 -66
- package/dist/validation/adapters/ClassValidatorAdapter.d.ts +0 -23
- package/dist/validation/adapters/ClassValidatorAdapter.js +0 -47
- package/dist/validation/adapters/ZodAdapter.d.ts +0 -14
- package/dist/validation/adapters/ZodAdapter.js +0 -56
- package/dist/validation/adapters/index.d.ts +0 -4
- package/dist/validation/adapters/index.js +0 -7
- package/dist/validation/index.d.ts +0 -3
- package/dist/validation/index.js +0 -20
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { TokenProvider } from '../commons';
|
|
2
|
-
import { Provider, ProviderType } from '../domain';
|
|
3
|
-
export declare class Container extends Map<TokenProvider, Provider> {
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @param token
|
|
7
|
-
* @param settings
|
|
8
|
-
*/
|
|
9
|
-
add(token: TokenProvider, settings?: Partial<Provider>): this;
|
|
10
|
-
/**
|
|
11
|
-
* Add a provider to the
|
|
12
|
-
* @param token
|
|
13
|
-
* @param settings
|
|
14
|
-
*/
|
|
15
|
-
addProvider(token: TokenProvider, settings?: Partial<Provider>): this;
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @param token
|
|
19
|
-
*/
|
|
20
|
-
hasProvider(token: TokenProvider): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Add a provider to the
|
|
23
|
-
* @param token
|
|
24
|
-
* @param provider
|
|
25
|
-
*/
|
|
26
|
-
setProvider(token: TokenProvider, provider: Provider): this;
|
|
27
|
-
/**
|
|
28
|
-
* The getProvider() method returns a specified element from a Map object.
|
|
29
|
-
* @returns Returns the element associated with the specified key or undefined if the key can't be found in the Map object.
|
|
30
|
-
* @param token
|
|
31
|
-
*/
|
|
32
|
-
getProvider<T extends Provider = Provider>(token: TokenProvider): T | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* Get all providers registered in the injector container.
|
|
35
|
-
*
|
|
36
|
-
* @param {ProviderType} type Filter the list by the given ProviderType.
|
|
37
|
-
* @returns {[TokenProvider , Provider<any>][]}
|
|
38
|
-
*/
|
|
39
|
-
getProviders(type?: ProviderType | string): Provider[];
|
|
40
|
-
addProviders(container: Map<TokenProvider, Provider>): void;
|
|
41
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Container = void 0;
|
|
4
|
-
const commons_1 = require("../commons");
|
|
5
|
-
const domain_1 = require("../domain");
|
|
6
|
-
class Container extends Map {
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @param token
|
|
10
|
-
* @param settings
|
|
11
|
-
*/
|
|
12
|
-
add(token, settings = {}) {
|
|
13
|
-
const provider = commons_1.GlobalProvider.get(token)?.clone() || new domain_1.Provider(token);
|
|
14
|
-
Object.assign(provider, settings);
|
|
15
|
-
return this.set(token, provider);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Add a provider to the
|
|
19
|
-
* @param token
|
|
20
|
-
* @param settings
|
|
21
|
-
*/
|
|
22
|
-
addProvider(token, settings = {}) {
|
|
23
|
-
return this.add(token, settings);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @param token
|
|
28
|
-
*/
|
|
29
|
-
hasProvider(token) {
|
|
30
|
-
return super.has(token);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Add a provider to the
|
|
34
|
-
* @param token
|
|
35
|
-
* @param provider
|
|
36
|
-
*/
|
|
37
|
-
setProvider(token, provider) {
|
|
38
|
-
return super.set(token, provider);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* The getProvider() method returns a specified element from a Map object.
|
|
42
|
-
* @returns Returns the element associated with the specified key or undefined if the key can't be found in the Map object.
|
|
43
|
-
* @param token
|
|
44
|
-
*/
|
|
45
|
-
getProvider(token) {
|
|
46
|
-
return super.get(token);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Get all providers registered in the injector container.
|
|
50
|
-
*
|
|
51
|
-
* @param {ProviderType} type Filter the list by the given ProviderType.
|
|
52
|
-
* @returns {[TokenProvider , Provider<any>][]}
|
|
53
|
-
*/
|
|
54
|
-
getProviders(type) {
|
|
55
|
-
// @ts-ignore
|
|
56
|
-
return [...this].reduce((providers, [_, provider]) => {
|
|
57
|
-
if (provider.type === type || !type) {
|
|
58
|
-
return [...providers, provider];
|
|
59
|
-
}
|
|
60
|
-
return providers;
|
|
61
|
-
}, []);
|
|
62
|
-
}
|
|
63
|
-
addProviders(container) {
|
|
64
|
-
container.forEach((provider) => {
|
|
65
|
-
if (!this.hasProvider(provider.provide)) {
|
|
66
|
-
this.setProvider(provider.provide, provider.clone());
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
exports.Container = Container;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createContainer = createContainer;
|
|
4
|
-
const container_1 = require("./container");
|
|
5
|
-
function createContainer(rootModule) {
|
|
6
|
-
const container = new container_1.Container();
|
|
7
|
-
// const container = new Container(GlobalProvider.entries());
|
|
8
|
-
if (rootModule) {
|
|
9
|
-
container.delete(rootModule);
|
|
10
|
-
}
|
|
11
|
-
return container;
|
|
12
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createInjector = createInjector;
|
|
4
|
-
const InjectorService_js_1 = require("./InjectorService.js");
|
|
5
|
-
function createInjector() {
|
|
6
|
-
return new InjectorService_js_1.InjectorService();
|
|
7
|
-
}
|
package/dist/container/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./container"), exports);
|
|
18
|
-
__exportStar(require("./ContainerConfiguration"), exports);
|
|
19
|
-
__exportStar(require("./createContainer"), exports);
|
|
20
|
-
__exportStar(require("./createInjector"), exports);
|
|
21
|
-
__exportStar(require("./middleware.resolver"), exports);
|
|
22
|
-
__exportStar(require("./InjectorService"), exports);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { InjectorService } from './InjectorService';
|
|
2
|
-
import { TokenRouteWithProvider } from './ContainerConfiguration';
|
|
3
|
-
import { LocalsContainer } from '../domain/LocalsContainer';
|
|
4
|
-
declare class MiddlewareResolver {
|
|
5
|
-
resolveMiddlewares(route: TokenRouteWithProvider, injector: InjectorService, local: LocalsContainer): Promise<void>;
|
|
6
|
-
private resolve;
|
|
7
|
-
}
|
|
8
|
-
export declare const MiddlewareRes: MiddlewareResolver;
|
|
9
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MiddlewareRes = void 0;
|
|
4
|
-
const Context_1 = require("../domain/Context");
|
|
5
|
-
class MiddlewareResolver {
|
|
6
|
-
async resolveMiddlewares(route, injector, local) {
|
|
7
|
-
if (route.middlewares.length == 0) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
await this.resolve(route.middlewares, injector, local);
|
|
11
|
-
}
|
|
12
|
-
async resolve(middlewares, injector, local) {
|
|
13
|
-
const context = local.get(Context_1.Context);
|
|
14
|
-
let currentIndex = 0;
|
|
15
|
-
const next = async () => {
|
|
16
|
-
if (currentIndex >= middlewares.length) {
|
|
17
|
-
// If all middlewares are already processed, do nothing.
|
|
18
|
-
// This avoids "Middleware stack exhausted" if a middleware calls `next()`
|
|
19
|
-
// when there are no more middlewares.
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
const middleware = middlewares[currentIndex++];
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
const instance = injector.invoke(middleware, local);
|
|
25
|
-
// Await the middleware execution.
|
|
26
|
-
// If the middleware throws, the exception will propagate.
|
|
27
|
-
await instance.handle(context, next);
|
|
28
|
-
};
|
|
29
|
-
if (middlewares.length === 0)
|
|
30
|
-
return;
|
|
31
|
-
// Start the middleware execution
|
|
32
|
-
await next();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.MiddlewareRes = new MiddlewareResolver();
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.DefaultRoutesCarno = void 0;
|
|
13
|
-
const controller_decorator_1 = require("./commons/decorators/controller.decorator");
|
|
14
|
-
const http_decorators_1 = require("./commons/decorators/http.decorators");
|
|
15
|
-
let DefaultRoutesCarno = class DefaultRoutesCarno {
|
|
16
|
-
async favicon() {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
exports.DefaultRoutesCarno = DefaultRoutesCarno;
|
|
21
|
-
__decorate([
|
|
22
|
-
(0, http_decorators_1.Get)("favicon.ico"),
|
|
23
|
-
__metadata("design:type", Function),
|
|
24
|
-
__metadata("design:paramtypes", []),
|
|
25
|
-
__metadata("design:returntype", Promise)
|
|
26
|
-
], DefaultRoutesCarno.prototype, "favicon", null);
|
|
27
|
-
exports.DefaultRoutesCarno = DefaultRoutesCarno = __decorate([
|
|
28
|
-
(0, controller_decorator_1.Controller)()
|
|
29
|
-
], DefaultRoutesCarno);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BaseContext - Interface mínima que todo contexto deve implementar.
|
|
3
|
-
*
|
|
4
|
-
* Define o contrato básico para FastContext e Context,
|
|
5
|
-
* permitindo que handlers compilados trabalhem com ambos.
|
|
6
|
-
*/
|
|
7
|
-
export interface BaseContext {
|
|
8
|
-
readonly req: Request;
|
|
9
|
-
param: Record<string, string>;
|
|
10
|
-
readonly headers: Headers;
|
|
11
|
-
readonly query: Record<string, string>;
|
|
12
|
-
status: number;
|
|
13
|
-
setResponseStatus(status: number): void;
|
|
14
|
-
getResponseStatus(): number;
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type CarnoClosure = () => void;
|
package/dist/domain/Context.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Server } from 'bun';
|
|
2
|
-
/**
|
|
3
|
-
* Context otimizado com shape mínimo e lazy loading.
|
|
4
|
-
*
|
|
5
|
-
* Shape fixo mínimo (sempre alocado):
|
|
6
|
-
* - req: Request
|
|
7
|
-
* - param: Record<string, string>
|
|
8
|
-
* - status: number
|
|
9
|
-
*
|
|
10
|
-
* Lazy loading (só aloca quando usado):
|
|
11
|
-
* - query: Record<string, string> (getter lazy)
|
|
12
|
-
* - headers: Headers (getter que retorna req.headers)
|
|
13
|
-
* - body: Record<string, any> (getter lazy)
|
|
14
|
-
* - locals: Record<string, any> (getter lazy)
|
|
15
|
-
* - rawBody: ArrayBuffer (lazy)
|
|
16
|
-
*
|
|
17
|
-
* V8/JSC otimiza shape consistente. Propriedades lazy não quebram
|
|
18
|
-
* monomorfismo porque são getters, não props dinâmicas.
|
|
19
|
-
*/
|
|
20
|
-
export declare class Context {
|
|
21
|
-
req: Request;
|
|
22
|
-
param: Record<string, string>;
|
|
23
|
-
status: number;
|
|
24
|
-
private _queryString;
|
|
25
|
-
private _query;
|
|
26
|
-
private _locals;
|
|
27
|
-
private _body;
|
|
28
|
-
private _rawBody;
|
|
29
|
-
private _bodyParsed;
|
|
30
|
-
private constructor();
|
|
31
|
-
get headers(): Headers;
|
|
32
|
-
get query(): Record<string, string>;
|
|
33
|
-
set query(value: Record<string, string>);
|
|
34
|
-
get locals(): Record<string, any>;
|
|
35
|
-
set locals(value: Record<string, any>);
|
|
36
|
-
get body(): Record<string, any>;
|
|
37
|
-
set body(value: Record<string, any>);
|
|
38
|
-
get rawBody(): ArrayBuffer | undefined;
|
|
39
|
-
set rawBody(value: ArrayBuffer | undefined);
|
|
40
|
-
getBody(): Promise<Record<string, any>>;
|
|
41
|
-
isBodyParsed(): boolean;
|
|
42
|
-
setResponseStatus(status: number): void;
|
|
43
|
-
getResponseStatus(): number;
|
|
44
|
-
setParam(param: Record<string, string>): void;
|
|
45
|
-
static createFromRequestSync(url: {
|
|
46
|
-
query?: string;
|
|
47
|
-
}, request: Request, server: Server<any>): Context;
|
|
48
|
-
static createFastContext(request: Request, params: Record<string, any>): Context;
|
|
49
|
-
static createFromRequest(url: {
|
|
50
|
-
query?: string;
|
|
51
|
-
}, request: Request, server: Server<any>): Promise<Context>;
|
|
52
|
-
static createFromJob(job: any): Context;
|
|
53
|
-
private parseQueryString;
|
|
54
|
-
private parseBody;
|
|
55
|
-
private parseJsonBody;
|
|
56
|
-
private parseFormDataBody;
|
|
57
|
-
private parseUrlEncodedBody;
|
|
58
|
-
}
|
package/dist/domain/Context.js
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var Context_1;
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.Context = void 0;
|
|
14
|
-
const http_code_enum_1 = require("../commons/http-code.enum");
|
|
15
|
-
const Injectable_decorator_1 = require("../commons/decorators/Injectable.decorator");
|
|
16
|
-
const HttpException_1 = require("../exceptions/HttpException");
|
|
17
|
-
const provider_scope_1 = require("./provider-scope");
|
|
18
|
-
/**
|
|
19
|
-
* Context otimizado com shape mínimo e lazy loading.
|
|
20
|
-
*
|
|
21
|
-
* Shape fixo mínimo (sempre alocado):
|
|
22
|
-
* - req: Request
|
|
23
|
-
* - param: Record<string, string>
|
|
24
|
-
* - status: number
|
|
25
|
-
*
|
|
26
|
-
* Lazy loading (só aloca quando usado):
|
|
27
|
-
* - query: Record<string, string> (getter lazy)
|
|
28
|
-
* - headers: Headers (getter que retorna req.headers)
|
|
29
|
-
* - body: Record<string, any> (getter lazy)
|
|
30
|
-
* - locals: Record<string, any> (getter lazy)
|
|
31
|
-
* - rawBody: ArrayBuffer (lazy)
|
|
32
|
-
*
|
|
33
|
-
* V8/JSC otimiza shape consistente. Propriedades lazy não quebram
|
|
34
|
-
* monomorfismo porque são getters, não props dinâmicas.
|
|
35
|
-
*/
|
|
36
|
-
let Context = Context_1 = class Context {
|
|
37
|
-
constructor() {
|
|
38
|
-
this._query = null;
|
|
39
|
-
this._locals = null;
|
|
40
|
-
this._body = null;
|
|
41
|
-
this._rawBody = null;
|
|
42
|
-
this._bodyParsed = false;
|
|
43
|
-
this.req = undefined;
|
|
44
|
-
this.status = 200;
|
|
45
|
-
}
|
|
46
|
-
get headers() {
|
|
47
|
-
return this.req.headers;
|
|
48
|
-
}
|
|
49
|
-
get query() {
|
|
50
|
-
if (this._query === null) {
|
|
51
|
-
this._query = this.parseQueryString();
|
|
52
|
-
}
|
|
53
|
-
return this._query;
|
|
54
|
-
}
|
|
55
|
-
set query(value) {
|
|
56
|
-
this._query = value;
|
|
57
|
-
}
|
|
58
|
-
get locals() {
|
|
59
|
-
if (this._locals === null) {
|
|
60
|
-
this._locals = {};
|
|
61
|
-
}
|
|
62
|
-
return this._locals;
|
|
63
|
-
}
|
|
64
|
-
set locals(value) {
|
|
65
|
-
this._locals = value;
|
|
66
|
-
}
|
|
67
|
-
get body() {
|
|
68
|
-
if (this._body === null) {
|
|
69
|
-
return {};
|
|
70
|
-
}
|
|
71
|
-
return this._body;
|
|
72
|
-
}
|
|
73
|
-
set body(value) {
|
|
74
|
-
this._body = value;
|
|
75
|
-
this._bodyParsed = true;
|
|
76
|
-
}
|
|
77
|
-
get rawBody() {
|
|
78
|
-
return this._rawBody ?? undefined;
|
|
79
|
-
}
|
|
80
|
-
set rawBody(value) {
|
|
81
|
-
this._rawBody = value ?? null;
|
|
82
|
-
}
|
|
83
|
-
async getBody() {
|
|
84
|
-
if (!this._bodyParsed) {
|
|
85
|
-
await this.parseBody();
|
|
86
|
-
}
|
|
87
|
-
return this._body ?? {};
|
|
88
|
-
}
|
|
89
|
-
isBodyParsed() {
|
|
90
|
-
return this._bodyParsed;
|
|
91
|
-
}
|
|
92
|
-
setResponseStatus(status) {
|
|
93
|
-
this.status = status;
|
|
94
|
-
}
|
|
95
|
-
getResponseStatus() {
|
|
96
|
-
return this.status;
|
|
97
|
-
}
|
|
98
|
-
setParam(param) {
|
|
99
|
-
this.param = param;
|
|
100
|
-
}
|
|
101
|
-
static createFromRequestSync(url, request, server) {
|
|
102
|
-
const ctx = new Context_1();
|
|
103
|
-
ctx.req = request;
|
|
104
|
-
ctx.param = {};
|
|
105
|
-
ctx._queryString = url.query;
|
|
106
|
-
const method = request.method;
|
|
107
|
-
if (method !== 'GET' && method !== 'HEAD') {
|
|
108
|
-
ctx._bodyParsed = false;
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
ctx._bodyParsed = true;
|
|
112
|
-
}
|
|
113
|
-
return ctx;
|
|
114
|
-
}
|
|
115
|
-
static createFastContext(request, params) {
|
|
116
|
-
const ctx = new Context_1();
|
|
117
|
-
ctx.req = request;
|
|
118
|
-
ctx.param = params;
|
|
119
|
-
ctx._bodyParsed = true;
|
|
120
|
-
return ctx;
|
|
121
|
-
}
|
|
122
|
-
static async createFromRequest(url, request, server) {
|
|
123
|
-
const ctx = Context_1.createFromRequestSync(url, request, server);
|
|
124
|
-
if (!ctx._bodyParsed) {
|
|
125
|
-
await ctx.getBody();
|
|
126
|
-
}
|
|
127
|
-
return ctx;
|
|
128
|
-
}
|
|
129
|
-
static createFromJob(job) {
|
|
130
|
-
return new Context_1();
|
|
131
|
-
}
|
|
132
|
-
parseQueryString() {
|
|
133
|
-
if (!this._queryString) {
|
|
134
|
-
return {};
|
|
135
|
-
}
|
|
136
|
-
return Object.fromEntries(new URLSearchParams(this._queryString));
|
|
137
|
-
}
|
|
138
|
-
async parseBody() {
|
|
139
|
-
this._bodyParsed = true;
|
|
140
|
-
const contentType = this.req.headers.get('content-type') ?? '';
|
|
141
|
-
if (contentType.includes('application/json')) {
|
|
142
|
-
this._body = await this.parseJsonBody();
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
if (contentType.includes('multipart/form-data')) {
|
|
146
|
-
this._body = await this.parseFormDataBody();
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if (contentType.includes('application/x-www-form-urlencoded')) {
|
|
150
|
-
this._body = await this.parseUrlEncodedBody();
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
this._body = {};
|
|
154
|
-
}
|
|
155
|
-
async parseJsonBody() {
|
|
156
|
-
const contentLength = this.req.headers.get('content-length');
|
|
157
|
-
if (contentLength === '0') {
|
|
158
|
-
return {};
|
|
159
|
-
}
|
|
160
|
-
try {
|
|
161
|
-
const payload = await this.req.json();
|
|
162
|
-
return payload;
|
|
163
|
-
}
|
|
164
|
-
catch {
|
|
165
|
-
throw new HttpException_1.HttpException('Invalid JSON body', http_code_enum_1.HttpCode.BAD_REQUEST);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
async parseFormDataBody() {
|
|
169
|
-
const formData = await this.req.formData();
|
|
170
|
-
const result = {};
|
|
171
|
-
for (const [key, value] of formData.entries()) {
|
|
172
|
-
result[key] = value;
|
|
173
|
-
}
|
|
174
|
-
return result;
|
|
175
|
-
}
|
|
176
|
-
async parseUrlEncodedBody() {
|
|
177
|
-
const text = await this.req.text();
|
|
178
|
-
if (!text) {
|
|
179
|
-
return {};
|
|
180
|
-
}
|
|
181
|
-
return Object.fromEntries(new URLSearchParams(text));
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
exports.Context = Context;
|
|
185
|
-
exports.Context = Context = Context_1 = __decorate([
|
|
186
|
-
(0, Injectable_decorator_1.Injectable)({ scope: provider_scope_1.ProviderScope.REQUEST }),
|
|
187
|
-
__metadata("design:paramtypes", [])
|
|
188
|
-
], Context);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { BaseContext } from './BaseContext';
|
|
2
|
-
/**
|
|
3
|
-
* FastContext - Contexto mínimo monomórfico para fast path.
|
|
4
|
-
*
|
|
5
|
-
* Shape fixo otimizado para V8/JSC JIT:
|
|
6
|
-
* - Apenas 3 propriedades diretas: req, param, status
|
|
7
|
-
* - Lazy getters para headers e query (zero alocação se não usados)
|
|
8
|
-
* - Sem locals, sem body, sem flags extras
|
|
9
|
-
* - Monomórfico: sempre mesmo shape, JIT otimiza agressivamente
|
|
10
|
-
*
|
|
11
|
-
* Usado quando:
|
|
12
|
-
* - Rota SIMPLE (RouteType.SIMPLE)
|
|
13
|
-
* - Sem middlewares
|
|
14
|
-
* - Sem DI
|
|
15
|
-
* - Sem body parsing
|
|
16
|
-
*/
|
|
17
|
-
export declare class FastContext implements BaseContext {
|
|
18
|
-
readonly req: Request;
|
|
19
|
-
param: Record<string, string>;
|
|
20
|
-
status: number;
|
|
21
|
-
private _query;
|
|
22
|
-
private _queryString;
|
|
23
|
-
constructor(req: Request, param: Record<string, string>, queryString: string | undefined);
|
|
24
|
-
get headers(): Headers;
|
|
25
|
-
get query(): Record<string, string>;
|
|
26
|
-
setResponseStatus(status: number): void;
|
|
27
|
-
getResponseStatus(): number;
|
|
28
|
-
private parseQueryString;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Factory otimizado para criar FastContext.
|
|
32
|
-
* Extrai queryString inline sem overhead de parseUrl.
|
|
33
|
-
*/
|
|
34
|
-
export declare function createFastContext(req: Request, param: Record<string, string>, url: string): FastContext;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FastContext = void 0;
|
|
4
|
-
exports.createFastContext = createFastContext;
|
|
5
|
-
/**
|
|
6
|
-
* FastContext - Contexto mínimo monomórfico para fast path.
|
|
7
|
-
*
|
|
8
|
-
* Shape fixo otimizado para V8/JSC JIT:
|
|
9
|
-
* - Apenas 3 propriedades diretas: req, param, status
|
|
10
|
-
* - Lazy getters para headers e query (zero alocação se não usados)
|
|
11
|
-
* - Sem locals, sem body, sem flags extras
|
|
12
|
-
* - Monomórfico: sempre mesmo shape, JIT otimiza agressivamente
|
|
13
|
-
*
|
|
14
|
-
* Usado quando:
|
|
15
|
-
* - Rota SIMPLE (RouteType.SIMPLE)
|
|
16
|
-
* - Sem middlewares
|
|
17
|
-
* - Sem DI
|
|
18
|
-
* - Sem body parsing
|
|
19
|
-
*/
|
|
20
|
-
class FastContext {
|
|
21
|
-
constructor(req, param, queryString) {
|
|
22
|
-
this.req = req;
|
|
23
|
-
this.param = param;
|
|
24
|
-
this.status = 200;
|
|
25
|
-
this._query = null;
|
|
26
|
-
this._queryString = queryString;
|
|
27
|
-
}
|
|
28
|
-
get headers() {
|
|
29
|
-
return this.req.headers;
|
|
30
|
-
}
|
|
31
|
-
get query() {
|
|
32
|
-
if (this._query === null) {
|
|
33
|
-
this._query = this.parseQueryString();
|
|
34
|
-
}
|
|
35
|
-
return this._query;
|
|
36
|
-
}
|
|
37
|
-
setResponseStatus(status) {
|
|
38
|
-
this.status = status;
|
|
39
|
-
}
|
|
40
|
-
getResponseStatus() {
|
|
41
|
-
return this.status;
|
|
42
|
-
}
|
|
43
|
-
parseQueryString() {
|
|
44
|
-
if (!this._queryString) {
|
|
45
|
-
return {};
|
|
46
|
-
}
|
|
47
|
-
return Object.fromEntries(new URLSearchParams(this._queryString));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.FastContext = FastContext;
|
|
51
|
-
/**
|
|
52
|
-
* Factory otimizado para criar FastContext.
|
|
53
|
-
* Extrai queryString inline sem overhead de parseUrl.
|
|
54
|
-
*/
|
|
55
|
-
function createFastContext(req, param, url) {
|
|
56
|
-
const queryIdx = url.indexOf('?');
|
|
57
|
-
const queryString = queryIdx !== -1 ? url.slice(queryIdx + 1) : undefined;
|
|
58
|
-
return new FastContext(req, param, queryString);
|
|
59
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LocalsContainer = void 0;
|
|
4
|
-
class LocalsContainer extends Map {
|
|
5
|
-
// readonly hooks = new Hooks();
|
|
6
|
-
async destroy() {
|
|
7
|
-
// await this.hooks.asyncEmit("$onDestroy");
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.LocalsContainer = LocalsContainer;
|