@midwayjs/decorator 3.0.10 → 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.
- package/dist/decorator/common/filter.d.ts +3 -1
- package/dist/decorator/common/filter.js +2 -1
- package/dist/decorator/common/index.js +5 -1
- package/dist/decorator/framework/index.d.ts +1 -1
- package/dist/decorator/framework/index.js +2 -2
- package/dist/decorator/index.js +5 -1
- package/dist/index.js +5 -1
- package/dist/util/uuid.js +1 -1
- package/package.json +2 -2
|
@@ -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);
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FrameworkType } from '../../';
|
|
2
2
|
export declare function Plugin(identifier?: string): PropertyDecorator;
|
|
3
3
|
export declare function Config(identifier?: string): PropertyDecorator;
|
|
4
|
-
export declare function App(
|
|
4
|
+
export declare function App(typeOrNamespace?: FrameworkType | string): PropertyDecorator;
|
|
5
5
|
export declare function Logger(identifier?: string): PropertyDecorator;
|
|
6
6
|
export declare function ApplicationContext(): PropertyDecorator;
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -14,9 +14,9 @@ function Config(identifier) {
|
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
exports.Config = Config;
|
|
17
|
-
function App(
|
|
17
|
+
function App(typeOrNamespace) {
|
|
18
18
|
return (0, __1.createCustomPropertyDecorator)(__1.APPLICATION_KEY, {
|
|
19
|
-
type,
|
|
19
|
+
type: typeOrNamespace,
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
exports.App = App;
|
package/dist/decorator/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/util/uuid.js
CHANGED
|
@@ -20,7 +20,7 @@ function rng() {
|
|
|
20
20
|
*/
|
|
21
21
|
const byteToHex = [];
|
|
22
22
|
for (let i = 0; i < 256; ++i) {
|
|
23
|
-
byteToHex.push((i + 0x100).toString(16).
|
|
23
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
24
24
|
}
|
|
25
25
|
function unsafeStringify(arr, offset = 0) {
|
|
26
26
|
// Note: Be careful editing this code! It's been tuned for performance
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/decorator",
|
|
3
|
-
"version": "3.0.
|
|
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
|
}
|