@eleven-am/pondsocket-nest 0.0.52 → 0.0.54
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/helpers/createParamDecorator.js +3 -1
- package/index.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createParamDecorator = void 0;
|
|
4
|
+
require("reflect-metadata");
|
|
4
5
|
const parametres_1 = require("../managers/parametres");
|
|
5
6
|
function createParamDecorator(callback) {
|
|
6
7
|
return (data) => (target, propertyKey, index) => {
|
|
7
8
|
const { set } = (0, parametres_1.manageParameters)(target, propertyKey);
|
|
8
|
-
|
|
9
|
+
const type = Reflect.getMetadata('design:paramtypes', target, propertyKey)[index];
|
|
10
|
+
set(index, (context) => callback(data, context, type));
|
|
9
11
|
};
|
|
10
12
|
}
|
|
11
13
|
exports.createParamDecorator = createParamDecorator;
|
package/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type { DynamicModule, ModuleMetadata } from '@nestjs/common';
|
|
|
18
18
|
|
|
19
19
|
type Constructor<T> = new (...args: any[]) => T;
|
|
20
20
|
|
|
21
|
-
type ParamDecoratorCallback<Input> = (data: Input, context: Context) => unknown | Promise<unknown>;
|
|
21
|
+
type ParamDecoratorCallback<Input, ParamType> = (data: Input, context: Context, type: ParamType) => unknown | Promise<unknown>;
|
|
22
22
|
|
|
23
23
|
interface CanActivate {
|
|
24
24
|
|
|
@@ -297,7 +297,7 @@ declare function PondGuards (...guards: Constructor<CanActivate>[]): ClassDecora
|
|
|
297
297
|
* @desc Helper function that creates a parameter decorator
|
|
298
298
|
* @param callback - The callback to run when the parameter is being retrieved
|
|
299
299
|
*/
|
|
300
|
-
declare function createParamDecorator<Input>(callback: ParamDecoratorCallback<Input>):
|
|
300
|
+
declare function createParamDecorator<Input, ParamType> (callback: ParamDecoratorCallback<Input, ParamType>): ParameterDecorator;
|
|
301
301
|
|
|
302
302
|
declare class PondSocketModule {
|
|
303
303
|
static forRoot({ guards, providers, imports, exports, isGlobal, appModuleName }: Metadata): DynamicModule;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eleven-am/pondsocket-nest",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.54",
|
|
4
4
|
"description": "PondSocket is a fast simple socket server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"socket",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"pipeline": "npm run lint && npm run build && npm run push"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@eleven-am/pondsocket": "^0.1.
|
|
31
|
+
"@eleven-am/pondsocket": "^0.1.154",
|
|
32
32
|
"@golevelup/nestjs-discovery": "^4.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|