@midwayjs/decorator 3.3.4 → 3.4.0-beta.1
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.
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare function Catch(catchTarget?: any | any[]
|
|
1
|
+
export declare function Catch(catchTarget?: any | any[], options?: {
|
|
2
|
+
matchPrototype?: boolean;
|
|
3
|
+
}): (target: any) => void;
|
|
2
4
|
export declare type MatchPattern<CtxOrReq = any, Res = any> = ((ctxOrReq: CtxOrReq, res: Res) => boolean) | string | string[] | boolean;
|
|
3
5
|
export declare function Match(matchPattern?: MatchPattern): (target: any) => void;
|
|
4
6
|
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -6,11 +6,12 @@ const constant_1 = require("../../constant");
|
|
|
6
6
|
const objectDef_1 = require("./objectDef");
|
|
7
7
|
const interface_1 = require("../../interface");
|
|
8
8
|
const provide_1 = require("./provide");
|
|
9
|
-
function Catch(catchTarget) {
|
|
9
|
+
function Catch(catchTarget, options = {}) {
|
|
10
10
|
return function (target) {
|
|
11
11
|
const catchTargets = catchTarget ? [].concat(catchTarget) : undefined;
|
|
12
12
|
(0, decoratorManager_1.saveClassMetadata)(constant_1.CATCH_KEY, {
|
|
13
13
|
catchTargets,
|
|
14
|
+
catchOptions: options,
|
|
14
15
|
}, target);
|
|
15
16
|
(0, objectDef_1.Scope)(interface_1.ScopeEnum.Singleton)(target);
|
|
16
17
|
(0, provide_1.Provide)()(target);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/decorator",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0-beta.1",
|
|
4
4
|
"description": "definition decorator for midway project",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "14d8440f20978426184c988808343cc24bcf6e20"
|
|
40
40
|
}
|