@bool-ts/core 1.9.9 → 1.9.12

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
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@bool-ts/core",
3
- "version": "1.9.9",
3
+ "version": "1.9.12",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
7
  "test": "bun --hot run __test/index.ts",
8
- "build": "tsc --emitDeclarationOnly && bun build ./src/index.ts --outdir ./dist --minify"
8
+ "build": "tsc --emitDeclarationOnly && bun build --minify --sourcemap ./src/index.ts --outdir ./dist"
9
9
  },
10
10
  "repository": {
11
11
  "type": "git",
@@ -28,5 +28,8 @@
28
28
  "@types/qs": "^6.9.18",
29
29
  "typescript": "^5.8.2"
30
30
  },
31
- "private": "false"
31
+ "private": "false",
32
+ "publishConfig": {
33
+ "access": "public"
34
+ }
32
35
  }
@@ -25,6 +25,7 @@ export {
25
25
  WebSocketCloseCode,
26
26
  WebSocketCloseReason,
27
27
  WebSocketConnection,
28
+ WebSocketMessage,
28
29
  WebSocketServer
29
30
  } from "./webSocketArguments";
30
31
  export { WebSocketEvent } from "./webSocketEvent";
@@ -142,3 +142,31 @@ export const WebSocketCloseReason =
142
142
  methodName
143
143
  );
144
144
  };
145
+
146
+ export const WebSocketMessage =
147
+ () => (target: Object, methodName: string | symbol | undefined, parameterIndex: number) => {
148
+ if (!methodName) {
149
+ return;
150
+ }
151
+
152
+ const webSocketEventArgumentsMetadata: TWebsocketArgumentsMetadataGroup =
153
+ Reflect.getOwnMetadata(webSocketEventArgumentsKey, target.constructor, methodName) ||
154
+ {};
155
+
156
+ webSocketEventArgumentsMetadata[`argumentIndexes.${parameterIndex}`] = {
157
+ index: parameterIndex,
158
+ type: webSocketMessageArgsKey
159
+ } satisfies Extract<
160
+ TWebsocketArgumentsMetadata,
161
+ {
162
+ type: typeof webSocketMessageArgsKey;
163
+ }
164
+ >;
165
+
166
+ Reflect.defineMetadata(
167
+ webSocketEventArgumentsKey,
168
+ webSocketEventArgumentsMetadata,
169
+ target.constructor,
170
+ methodName
171
+ );
172
+ };