moost 0.3.28 → 0.3.29
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 +17 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +10 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -233,6 +233,14 @@ function getInstanceOwnMethods(instance) {
|
|
|
233
233
|
...Object.getOwnPropertyNames(instance),
|
|
234
234
|
].filter(m => typeof instance[m] === 'function');
|
|
235
235
|
}
|
|
236
|
+
function getInstanceOwnProps(instance) {
|
|
237
|
+
const proto = Object.getPrototypeOf(instance);
|
|
238
|
+
return [
|
|
239
|
+
...getParentProps(mate$1.getConstructor(instance)),
|
|
240
|
+
...Object.getOwnPropertyNames(proto),
|
|
241
|
+
...Object.getOwnPropertyNames(instance),
|
|
242
|
+
].filter(m => typeof instance[m] !== 'function');
|
|
243
|
+
}
|
|
236
244
|
const fnProto = Object.getPrototypeOf(Function);
|
|
237
245
|
function getParentProps(constructor) {
|
|
238
246
|
const parent = Object.getPrototypeOf(constructor);
|
|
@@ -828,6 +836,14 @@ Object.defineProperty(exports, "createProvideRegistry", {
|
|
|
828
836
|
enumerable: true,
|
|
829
837
|
get: function () { return infact$1.createProvideRegistry; }
|
|
830
838
|
});
|
|
839
|
+
Object.defineProperty(exports, "getConstructor", {
|
|
840
|
+
enumerable: true,
|
|
841
|
+
get: function () { return mate$1.getConstructor; }
|
|
842
|
+
});
|
|
843
|
+
Object.defineProperty(exports, "isConstructor", {
|
|
844
|
+
enumerable: true,
|
|
845
|
+
get: function () { return mate$1.isConstructor; }
|
|
846
|
+
});
|
|
831
847
|
exports.Circular = Circular;
|
|
832
848
|
exports.Const = Const;
|
|
833
849
|
exports.ConstFactory = ConstFactory;
|
|
@@ -855,6 +871,7 @@ exports.defineInterceptorFn = defineInterceptorFn;
|
|
|
855
871
|
exports.defineMoostEventHandler = defineMoostEventHandler;
|
|
856
872
|
exports.definePipeFn = definePipeFn;
|
|
857
873
|
exports.getInstanceOwnMethods = getInstanceOwnMethods;
|
|
874
|
+
exports.getInstanceOwnProps = getInstanceOwnProps;
|
|
858
875
|
exports.getMoostInfact = getMoostInfact;
|
|
859
876
|
exports.getMoostMate = getMoostMate;
|
|
860
877
|
exports.getNewMoostInfact = getNewMoostInfact;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { TProvideRegistry, createProvideRegistry } from '@prostojs/infact';
|
|
|
5
5
|
import { TConsoleBase } from '@prostojs/logger';
|
|
6
6
|
import * as _prostojs_mate from '@prostojs/mate';
|
|
7
7
|
import { TMateParamMeta, Mate } from '@prostojs/mate';
|
|
8
|
+
export { getConstructor, isConstructor } from '@prostojs/mate';
|
|
8
9
|
|
|
9
10
|
type TAny = any;
|
|
10
11
|
type TAnyFn = (...a: TAny[]) => unknown;
|
|
@@ -350,6 +351,7 @@ declare function registerEventScope(scopeId: string): () => void;
|
|
|
350
351
|
declare function defineMoostEventHandler<T>(options: TMoostEventHandlerOptions<T>): () => Promise<unknown>;
|
|
351
352
|
|
|
352
353
|
declare function getInstanceOwnMethods<T = TAny>(instance: T): Array<keyof T>;
|
|
354
|
+
declare function getInstanceOwnProps<T = TAny>(instance: T): Array<keyof T>;
|
|
353
355
|
|
|
354
356
|
interface TControllerOverview {
|
|
355
357
|
meta: TMoostMetadata;
|
|
@@ -564,4 +566,4 @@ type TInterceptorClass = TClassFunction<TInterceptorFn>;
|
|
|
564
566
|
*/
|
|
565
567
|
declare function definePipeFn<T extends TObject = TEmpty>(fn: TPipeFn<T>, priority?: TPipePriority): TPipeFn<T>;
|
|
566
568
|
|
|
567
|
-
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 };
|
|
569
|
+
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 TClassConstructor, 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, getInstanceOwnProps, getMoostInfact, getMoostMate, getNewMoostInfact, registerEventScope, resolvePipe, setControllerContext, useControllerContext };
|
package/dist/index.mjs
CHANGED
|
@@ -3,6 +3,7 @@ export { EventLogger, useEventContext, useEventLogger } from '@wooksjs/event-cor
|
|
|
3
3
|
import { Infact, createProvideRegistry } from '@prostojs/infact';
|
|
4
4
|
export { createProvideRegistry } from '@prostojs/infact';
|
|
5
5
|
import { Mate, getConstructor, isConstructor } from '@prostojs/mate';
|
|
6
|
+
export { getConstructor, isConstructor } from '@prostojs/mate';
|
|
6
7
|
import { ProstoLogger, createConsoleTransort, coloredConsole } from '@prostojs/logger';
|
|
7
8
|
|
|
8
9
|
async function runPipes(pipes, initialValue, metas, level, restoreCtx) {
|
|
@@ -233,6 +234,14 @@ function getInstanceOwnMethods(instance) {
|
|
|
233
234
|
...Object.getOwnPropertyNames(instance),
|
|
234
235
|
].filter(m => typeof instance[m] === 'function');
|
|
235
236
|
}
|
|
237
|
+
function getInstanceOwnProps(instance) {
|
|
238
|
+
const proto = Object.getPrototypeOf(instance);
|
|
239
|
+
return [
|
|
240
|
+
...getParentProps(getConstructor(instance)),
|
|
241
|
+
...Object.getOwnPropertyNames(proto),
|
|
242
|
+
...Object.getOwnPropertyNames(instance),
|
|
243
|
+
].filter(m => typeof instance[m] !== 'function');
|
|
244
|
+
}
|
|
236
245
|
const fnProto = Object.getPrototypeOf(Function);
|
|
237
246
|
function getParentProps(constructor) {
|
|
238
247
|
const parent = Object.getPrototypeOf(constructor);
|
|
@@ -812,4 +821,4 @@ class Moost {
|
|
|
812
821
|
}
|
|
813
822
|
}
|
|
814
823
|
|
|
815
|
-
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 };
|
|
824
|
+
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, getInstanceOwnProps, 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.29",
|
|
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.3.2",
|
|
36
36
|
"@prostojs/logger": "^0.4.0",
|
|
37
|
-
"@wooksjs/event-core": "^0.4.
|
|
38
|
-
"wooks": "^0.4.
|
|
37
|
+
"@wooksjs/event-core": "^0.4.31",
|
|
38
|
+
"wooks": "^0.4.31"
|
|
39
39
|
},
|
|
40
40
|
"author": "Artem Maltsev",
|
|
41
41
|
"license": "MIT",
|