@bool-ts/core 2.1.0 → 2.1.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/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "@bool-ts/date-time": "^1.0.0",
8
8
  "qs": "^6.14.0",
9
9
  "reflect-metadata": "^0.2.2",
10
- "zod": "^4.1.12"
10
+ "zod": "^4.2.1"
11
11
  },
12
12
  "description": "Core package for BoolTS framework",
13
13
  "devDependencies": {
@@ -43,5 +43,5 @@
43
43
  "test": "bun --hot run __test/index.ts"
44
44
  },
45
45
  "types": "./dist/index.d.ts",
46
- "version": "2.1.0"
47
- }
46
+ "version": "2.1.2"
47
+ }
@@ -332,7 +332,7 @@ export class Application<TRootClass extends Object = Object> {
332
332
  new Response(
333
333
  JSON.stringify({
334
334
  httpCode: 404,
335
- message: "Route not found",
335
+ message: "Route not found.",
336
336
  data: undefined
337
337
  }),
338
338
  {
@@ -515,7 +515,7 @@ export class Application<TRootClass extends Object = Object> {
515
515
  responseBodyArgsKey,
516
516
  JSON.stringify({
517
517
  httpCode: 404,
518
- message: "Route not found",
518
+ message: "Route not found.",
519
519
  data: undefined
520
520
  })
521
521
  );
@@ -988,33 +988,38 @@ export class Application<TRootClass extends Object = Object> {
988
988
 
989
989
  //#region [Configuration(s)]
990
990
  const { config } = Object.freeze({
991
- config: {
992
- ...(typeof options.config !== "function" ? options.config : await options.config()),
993
- ...(typeof moduleConfig !== "function"
994
- ? typeof moduleConfig !== "object"
995
- ? undefined
996
- : "key" in moduleConfig &&
997
- "value" in moduleConfig &&
998
- typeof moduleConfig.key === "symbol"
999
- ? typeof moduleConfig.value !== "function"
1000
- ? moduleConfig.value
1001
- : await moduleConfig.value()
1002
- : moduleConfig
1003
- : await moduleConfig())
1004
- }
991
+ config: !moduleConfig
992
+ ? undefined
993
+ : {
994
+ ...(typeof options.config !== "function"
995
+ ? options.config
996
+ : await options.config()),
997
+ ...(typeof moduleConfig !== "function"
998
+ ? typeof moduleConfig !== "object"
999
+ ? undefined
1000
+ : "key" in moduleConfig &&
1001
+ "value" in moduleConfig &&
1002
+ typeof moduleConfig.key === "symbol"
1003
+ ? typeof moduleConfig.value !== "function"
1004
+ ? moduleConfig.value
1005
+ : await moduleConfig.value()
1006
+ : moduleConfig
1007
+ : await moduleConfig())
1008
+ }
1005
1009
  });
1006
1010
  //#endregion
1007
1011
 
1008
1012
  //#region [Register config like an injection]
1009
- injector.set(
1010
- moduleConfig &&
1011
- "key" in moduleConfig &&
1012
- "value" in moduleConfig &&
1013
- typeof moduleConfig.key === "symbol"
1014
- ? moduleConfig.key
1015
- : configKey,
1016
- config
1017
- );
1013
+ config &&
1014
+ injector.set(
1015
+ moduleConfig &&
1016
+ "key" in moduleConfig &&
1017
+ "value" in moduleConfig &&
1018
+ typeof moduleConfig.key === "symbol"
1019
+ ? moduleConfig.key
1020
+ : configKey,
1021
+ config
1022
+ );
1018
1023
  //#endregion
1019
1024
 
1020
1025
  //#region [Run loader(s)]
package/src/keys/index.ts CHANGED
@@ -1,36 +1,42 @@
1
- export const argumentsKey = Symbol("__bool:arguments__");
2
- export const webSocketEventArgumentsKey = Symbol("__bool:webSocketEventArguments__");
3
- export const configKey = Symbol("__bool:config__");
4
- export const controllerKey = Symbol("__bool:controller__");
5
- export const interceptorKey = Symbol("__bool:interceptor__");
6
- export const guardKey = Symbol("__bool:guard__");
7
- export const controllerHttpKey = Symbol("__bool:controller.http__");
8
- export const injectKey = Symbol("__bool:inject__");
9
- export const injectableKey = Symbol("__bool:injectable__");
10
- export const middlewareKey = Symbol("__bool:middleware__");
11
- export const moduleKey = Symbol("__bool:module__");
12
- export const containerKey = Symbol("__bool:container__");
13
- export const zodSchemaKey = Symbol("__bool:zodSchema__");
14
- export const webSocketKey = Symbol("__bool:webSocket__");
15
- export const webSocketEventKey = Symbol("__bool:webSocket:event__");
1
+ const prefix = "__boolTypescriptCore";
16
2
 
17
- export const webSocketServerArgsKey = Symbol("__bool:webSocketArguments:server__");
18
- export const webSocketConnectionArgsKey = Symbol("__bool:webSocketArguments:connection__");
19
- export const webSocketMessageArgsKey = Symbol("__bool:webSocketArguments:message__");
20
- export const webSocketCloseCodeArgsKey = Symbol("__bool:webSocketArguments:closeCode__");
21
- export const webSocketCloseReasonArgsKey = Symbol("__bool:webSocketArguments:closeReason__");
3
+ export const argumentsKey = Symbol.for(`__${prefix}:arguments__`);
4
+ export const webSocketEventArgumentsKey = Symbol.for(`__${prefix}:webSocketEventArguments__`);
5
+ export const configKey = Symbol.for(`__${prefix}:config__`);
6
+ export const controllerKey = Symbol.for(`__${prefix}:controller__`);
7
+ export const interceptorKey = Symbol.for(`__${prefix}:interceptor__`);
8
+ export const guardKey = Symbol.for(`__${prefix}:guard__`);
9
+ export const controllerHttpKey = Symbol.for(`__${prefix}:controller.http__`);
10
+ export const injectKey = Symbol.for(`__${prefix}:inject__`);
11
+ export const injectableKey = Symbol.for(`__${prefix}:injectable__`);
12
+ export const middlewareKey = Symbol.for(`__${prefix}:middleware__`);
13
+ export const moduleKey = Symbol.for(`__${prefix}:module__`);
14
+ export const containerKey = Symbol.for(`__${prefix}:container__`);
15
+ export const zodSchemaKey = Symbol.for(`__${prefix}:zodSchema__`);
16
+ export const webSocketKey = Symbol.for(`__${prefix}:webSocket__`);
17
+ export const webSocketEventKey = Symbol.for(`__${prefix}:webSocket:event__`);
22
18
 
23
- export const httpServerArgsKey = Symbol("__bool:httpArguments:server__");
24
- export const requestHeadersArgsKey = Symbol("__bool:httpArguments:requestHeaders__");
25
- export const requestHeaderArgsKey = Symbol("__bool:httpArguments:requestHeader__");
26
- export const requestBodyArgsKey = Symbol("__bool:httpArguments:requestBody__");
27
- export const paramsArgsKey = Symbol("__bool:httpArguments:params__");
28
- export const paramArgsKey = Symbol("__bool:httpArguments:param__");
29
- export const queryArgsKey = Symbol("__bool:httpArguments:query__");
30
- export const requestArgsKey = Symbol("__bool:httpArguments:request__");
31
- export const responseHeadersArgsKey = Symbol("__bool:httpArguments:responseHeaders__");
32
- export const contextArgsKey = Symbol("__bool:httpArguments:context__");
33
- export const routeModelArgsKey = Symbol("__bool:httpArguments:routeModel__");
34
- export const responseBodyArgsKey = Symbol("__bool:httpArguments:responseBody__");
35
- export const responseStatusArgsKey = Symbol("__bool:httpArguments:responseStatus__");
36
- export const responseStatusTextArgsKey = Symbol("__bool:httpArguments:responseStatusText__");
19
+ export const webSocketServerArgsKey = Symbol.for(`__${prefix}:webSocketArguments:server__`);
20
+ export const webSocketConnectionArgsKey = Symbol.for(`__${prefix}:webSocketArguments:connection__`);
21
+ export const webSocketMessageArgsKey = Symbol.for(`__${prefix}:webSocketArguments:message__`);
22
+ export const webSocketCloseCodeArgsKey = Symbol.for(`__${prefix}:webSocketArguments:closeCode__`);
23
+ export const webSocketCloseReasonArgsKey = Symbol.for(
24
+ `__${prefix}:webSocketArguments:closeReason__`
25
+ );
26
+
27
+ export const httpServerArgsKey = Symbol.for(`__${prefix}:httpArguments:server__`);
28
+ export const requestHeadersArgsKey = Symbol.for(`__${prefix}:httpArguments:requestHeaders__`);
29
+ export const requestHeaderArgsKey = Symbol.for(`__${prefix}:httpArguments:requestHeader__`);
30
+ export const requestBodyArgsKey = Symbol.for(`__${prefix}:httpArguments:requestBody__`);
31
+ export const paramsArgsKey = Symbol.for(`__${prefix}:httpArguments:params__`);
32
+ export const paramArgsKey = Symbol.for(`__${prefix}:httpArguments:param__`);
33
+ export const queryArgsKey = Symbol.for(`__${prefix}:httpArguments:query__`);
34
+ export const requestArgsKey = Symbol.for(`__${prefix}:httpArguments:request__`);
35
+ export const responseHeadersArgsKey = Symbol.for(`__${prefix}:httpArguments:responseHeaders__`);
36
+ export const contextArgsKey = Symbol.for(`__${prefix}:httpArguments:context__`);
37
+ export const routeModelArgsKey = Symbol.for(`__${prefix}:httpArguments:routeModel__`);
38
+ export const responseBodyArgsKey = Symbol.for(`__${prefix}:httpArguments:responseBody__`);
39
+ export const responseStatusArgsKey = Symbol.for(`__${prefix}:httpArguments:responseStatus__`);
40
+ export const responseStatusTextArgsKey = Symbol.for(
41
+ `__${prefix}:httpArguments:responseStatusText__`
42
+ );