moost 0.3.20 → 0.3.22
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/index.cjs +24 -23
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +25 -25
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -5,6 +5,29 @@ var infact$1 = require('@prostojs/infact');
|
|
|
5
5
|
var eventCore = require('@wooksjs/event-core');
|
|
6
6
|
var logger = require('@prostojs/logger');
|
|
7
7
|
|
|
8
|
+
function getInstanceOwnMethods(instance) {
|
|
9
|
+
const proto = Object.getPrototypeOf(instance);
|
|
10
|
+
return [
|
|
11
|
+
...getParentProps(mate$1.getConstructor(instance)),
|
|
12
|
+
...Object.getOwnPropertyNames(proto),
|
|
13
|
+
...Object.getOwnPropertyNames(instance),
|
|
14
|
+
].filter((m) => typeof instance[m] === 'function');
|
|
15
|
+
}
|
|
16
|
+
const fnProto = Object.getPrototypeOf(Function);
|
|
17
|
+
function getParentProps(constructor) {
|
|
18
|
+
const parent = Object.getPrototypeOf(constructor);
|
|
19
|
+
if (typeof parent === 'function' &&
|
|
20
|
+
parent !== fnProto &&
|
|
21
|
+
parent !== constructor &&
|
|
22
|
+
parent.prototype) {
|
|
23
|
+
return [
|
|
24
|
+
...getParentProps(parent),
|
|
25
|
+
...Object.getOwnPropertyNames(parent.prototype),
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
|
|
8
31
|
const METADATA_WORKSPACE = 'moost';
|
|
9
32
|
const moostMate = new mate$1.Mate(METADATA_WORKSPACE, {
|
|
10
33
|
readType: true,
|
|
@@ -85,29 +108,6 @@ function getNewMoostInfact() {
|
|
|
85
108
|
});
|
|
86
109
|
}
|
|
87
110
|
|
|
88
|
-
function getInstanceOwnMethods(instance) {
|
|
89
|
-
const proto = Object.getPrototypeOf(instance);
|
|
90
|
-
return [
|
|
91
|
-
...getParentProps(mate$1.getConstructor(instance)),
|
|
92
|
-
...Object.getOwnPropertyNames(proto),
|
|
93
|
-
...Object.getOwnPropertyNames(instance),
|
|
94
|
-
].filter((m) => typeof instance[m] === 'function');
|
|
95
|
-
}
|
|
96
|
-
const fnProto = Object.getPrototypeOf(Function);
|
|
97
|
-
function getParentProps(constructor) {
|
|
98
|
-
const parent = Object.getPrototypeOf(constructor);
|
|
99
|
-
if (typeof parent === 'function' &&
|
|
100
|
-
parent !== fnProto &&
|
|
101
|
-
parent !== constructor &&
|
|
102
|
-
parent.prototype) {
|
|
103
|
-
return [
|
|
104
|
-
...getParentProps(parent),
|
|
105
|
-
...Object.getOwnPropertyNames(parent.prototype),
|
|
106
|
-
];
|
|
107
|
-
}
|
|
108
|
-
return [];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
111
|
async function getCallableFn(targetInstance, fn, restoreCtx, pipes, logger) {
|
|
112
112
|
const mate = getMoostMate();
|
|
113
113
|
const meta = mate.read(fn);
|
|
@@ -867,6 +867,7 @@ exports.Value = Value;
|
|
|
867
867
|
exports.defineInterceptorFn = defineInterceptorFn;
|
|
868
868
|
exports.defineMoostEventHandler = defineMoostEventHandler;
|
|
869
869
|
exports.definePipeFn = definePipeFn;
|
|
870
|
+
exports.getInstanceOwnMethods = getInstanceOwnMethods;
|
|
870
871
|
exports.getMoostInfact = getMoostInfact;
|
|
871
872
|
exports.getMoostMate = getMoostMate;
|
|
872
873
|
exports.getNewMoostInfact = getNewMoostInfact;
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ type TClassConstructor<T = unknown> = new (...args: TAny[]) => T;
|
|
|
16
16
|
interface TEmpty {
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
declare function getInstanceOwnMethods<T = TAny>(instance: T): (keyof T)[];
|
|
20
|
+
|
|
19
21
|
interface TClassFunction<T extends TAnyFn = TAnyFn> {
|
|
20
22
|
handler: T;
|
|
21
23
|
}
|
|
@@ -570,4 +572,4 @@ type TInterceptorClass = TClassFunction<TInterceptorFn>;
|
|
|
570
572
|
*/
|
|
571
573
|
declare function definePipeFn<T extends TObject = TEmpty>(fn: TPipeFn<T>, priority?: TPipePriority): TPipeFn<T>;
|
|
572
574
|
|
|
573
|
-
export { Circular, Const, ConstFactory, Controller, Description, Id, ImportController, Inherit, Inject, InjectEventLogger, Injectable, Intercept, InterceptorHandler, Label, Moost, Optional, Param, Params, Pipe, Provide, Required, Resolve, type TCallableClassFunction, type TClassFunction, type TControllerOverview, type TInjectableScope, type TInterceptorAfter, type TInterceptorBefore, type TInterceptorClass, type TInterceptorData, type TInterceptorFn, type TInterceptorOnError, TInterceptorPriority, type TMoostAdapter, type TMoostAdapterOptions, type TMoostEventHandlerHookOptions, type TMoostEventHandlerOptions, type TMoostHandler, type TMoostMetadata, type TMoostOptions, type TMoostParamsMetadata, type TPipeData, type TPipeFn, type TPipeMetas, TPipePriority, Value, defineInterceptorFn, defineMoostEventHandler, definePipeFn, getMoostInfact, getMoostMate, getNewMoostInfact, registerEventScope, resolvePipe, setControllerContext, useControllerContext };
|
|
575
|
+
export { Circular, Const, ConstFactory, Controller, Description, Id, ImportController, Inherit, Inject, InjectEventLogger, Injectable, Intercept, InterceptorHandler, Label, Moost, Optional, Param, Params, Pipe, Provide, Required, Resolve, type TCallableClassFunction, type TClassFunction, type TControllerOverview, type TInjectableScope, type TInterceptorAfter, type TInterceptorBefore, type TInterceptorClass, type TInterceptorData, type TInterceptorFn, type TInterceptorOnError, TInterceptorPriority, type TMoostAdapter, type TMoostAdapterOptions, type TMoostEventHandlerHookOptions, type TMoostEventHandlerOptions, type TMoostHandler, type TMoostMetadata, type TMoostOptions, type TMoostParamsMetadata, type TPipeData, type TPipeFn, type TPipeMetas, TPipePriority, Value, defineInterceptorFn, defineMoostEventHandler, definePipeFn, getInstanceOwnMethods, getMoostInfact, getMoostMate, getNewMoostInfact, registerEventScope, resolvePipe, setControllerContext, useControllerContext };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getConstructor, Mate, isConstructor } from '@prostojs/mate';
|
|
2
2
|
import { Infact, createProvideRegistry } from '@prostojs/infact';
|
|
3
3
|
export { createProvideRegistry } from '@prostojs/infact';
|
|
4
4
|
import { useEventId, useEventContext, useRouteParams, useEventLogger } from '@wooksjs/event-core';
|
|
5
5
|
export { EventLogger, useEventContext, useEventLogger } from '@wooksjs/event-core';
|
|
6
6
|
import { ProstoLogger, createConsoleTransort, coloredConsole } from '@prostojs/logger';
|
|
7
7
|
|
|
8
|
+
function getInstanceOwnMethods(instance) {
|
|
9
|
+
const proto = Object.getPrototypeOf(instance);
|
|
10
|
+
return [
|
|
11
|
+
...getParentProps(getConstructor(instance)),
|
|
12
|
+
...Object.getOwnPropertyNames(proto),
|
|
13
|
+
...Object.getOwnPropertyNames(instance),
|
|
14
|
+
].filter((m) => typeof instance[m] === 'function');
|
|
15
|
+
}
|
|
16
|
+
const fnProto = Object.getPrototypeOf(Function);
|
|
17
|
+
function getParentProps(constructor) {
|
|
18
|
+
const parent = Object.getPrototypeOf(constructor);
|
|
19
|
+
if (typeof parent === 'function' &&
|
|
20
|
+
parent !== fnProto &&
|
|
21
|
+
parent !== constructor &&
|
|
22
|
+
parent.prototype) {
|
|
23
|
+
return [
|
|
24
|
+
...getParentProps(parent),
|
|
25
|
+
...Object.getOwnPropertyNames(parent.prototype),
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
|
|
8
31
|
const METADATA_WORKSPACE = 'moost';
|
|
9
32
|
const moostMate = new Mate(METADATA_WORKSPACE, {
|
|
10
33
|
readType: true,
|
|
@@ -85,29 +108,6 @@ function getNewMoostInfact() {
|
|
|
85
108
|
});
|
|
86
109
|
}
|
|
87
110
|
|
|
88
|
-
function getInstanceOwnMethods(instance) {
|
|
89
|
-
const proto = Object.getPrototypeOf(instance);
|
|
90
|
-
return [
|
|
91
|
-
...getParentProps(getConstructor(instance)),
|
|
92
|
-
...Object.getOwnPropertyNames(proto),
|
|
93
|
-
...Object.getOwnPropertyNames(instance),
|
|
94
|
-
].filter((m) => typeof instance[m] === 'function');
|
|
95
|
-
}
|
|
96
|
-
const fnProto = Object.getPrototypeOf(Function);
|
|
97
|
-
function getParentProps(constructor) {
|
|
98
|
-
const parent = Object.getPrototypeOf(constructor);
|
|
99
|
-
if (typeof parent === 'function' &&
|
|
100
|
-
parent !== fnProto &&
|
|
101
|
-
parent !== constructor &&
|
|
102
|
-
parent.prototype) {
|
|
103
|
-
return [
|
|
104
|
-
...getParentProps(parent),
|
|
105
|
-
...Object.getOwnPropertyNames(parent.prototype),
|
|
106
|
-
];
|
|
107
|
-
}
|
|
108
|
-
return [];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
111
|
async function getCallableFn(targetInstance, fn, restoreCtx, pipes, logger) {
|
|
112
112
|
const mate = getMoostMate();
|
|
113
113
|
const meta = mate.read(fn);
|
|
@@ -825,4 +825,4 @@ function defineMoostEventHandler(options) {
|
|
|
825
825
|
};
|
|
826
826
|
}
|
|
827
827
|
|
|
828
|
-
export { Circular, Const, ConstFactory, Controller, Description, Id, ImportController, Inherit, Inject, InjectEventLogger, Injectable, Intercept, InterceptorHandler, Label, Moost, Optional, Param, Params, Pipe, Provide, Required, Resolve, TInterceptorPriority, TPipePriority, Value, defineInterceptorFn, defineMoostEventHandler, definePipeFn, getMoostInfact, getMoostMate, getNewMoostInfact, registerEventScope, resolvePipe, setControllerContext, useControllerContext };
|
|
828
|
+
export { Circular, Const, ConstFactory, Controller, Description, Id, ImportController, Inherit, Inject, InjectEventLogger, Injectable, Intercept, InterceptorHandler, Label, Moost, Optional, Param, Params, Pipe, Provide, Required, Resolve, TInterceptorPriority, TPipePriority, Value, defineInterceptorFn, defineMoostEventHandler, definePipeFn, getInstanceOwnMethods, getMoostInfact, getMoostMate, getNewMoostInfact, registerEventScope, resolvePipe, setControllerContext, useControllerContext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moost",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.22",
|
|
4
4
|
"description": "moost",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@prostojs/infact": "^0.1.13",
|
|
35
35
|
"@prostojs/mate": "^0.2.1",
|
|
36
36
|
"@prostojs/logger": "^0.4.0",
|
|
37
|
-
"@wooksjs/event-core": "^0.4.
|
|
38
|
-
"wooks": "^0.4.
|
|
37
|
+
"@wooksjs/event-core": "^0.4.24",
|
|
38
|
+
"wooks": "^0.4.24"
|
|
39
39
|
},
|
|
40
40
|
"author": "Artem Maltsev",
|
|
41
41
|
"license": "MIT",
|