@tsed/core 6.114.5 → 6.114.8
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,23 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.decorateMethodsOf = void 0;
|
|
4
|
+
const Store_1 = require("../../domain/Store");
|
|
4
5
|
const classOf_1 = require("../objects/classOf");
|
|
6
|
+
const descriptorOf_1 = require("../objects/descriptorOf");
|
|
5
7
|
const methodsOf_1 = require("../objects/methodsOf");
|
|
6
8
|
const prototypeOf_1 = require("../objects/prototypeOf");
|
|
7
|
-
const descriptorOf_1 = require("../objects/descriptorOf");
|
|
8
|
-
const Store_1 = require("../../domain/Store");
|
|
9
9
|
function decorateMethodsOf(klass, decorator) {
|
|
10
10
|
(0, methodsOf_1.methodsOf)(klass).forEach(({ target, propertyKey }) => {
|
|
11
|
+
const proto = (0, prototypeOf_1.prototypeOf)(klass);
|
|
11
12
|
if (target !== (0, classOf_1.classOf)(klass)) {
|
|
12
|
-
Object.defineProperty(
|
|
13
|
+
Object.defineProperty(proto, propertyKey, {
|
|
13
14
|
writable: true,
|
|
15
|
+
configurable: true,
|
|
14
16
|
value(...args) {
|
|
15
17
|
return (0, prototypeOf_1.prototypeOf)(target)[propertyKey].apply(this, args);
|
|
16
18
|
}
|
|
17
19
|
});
|
|
18
20
|
Store_1.Store.mergeStoreMethodFrom(klass, target, propertyKey);
|
|
19
21
|
}
|
|
20
|
-
decorator(
|
|
22
|
+
const newDescriptor = decorator(proto, propertyKey, (0, descriptorOf_1.descriptorOf)(klass, propertyKey));
|
|
23
|
+
if (newDescriptor) {
|
|
24
|
+
Object.defineProperty(proto, propertyKey, newDescriptor);
|
|
25
|
+
}
|
|
21
26
|
});
|
|
22
27
|
}
|
|
23
28
|
exports.decorateMethodsOf = decorateMethodsOf;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorateMethodsOf.js","sourceRoot":"","sources":["../../../../src/utils/decorators/decorateMethodsOf.ts"],"names":[],"mappings":";;;AAAA,gDAA2C;AAC3C,oDAA+C;AAC/C,wDAAmD;
|
|
1
|
+
{"version":3,"file":"decorateMethodsOf.js","sourceRoot":"","sources":["../../../../src/utils/decorators/decorateMethodsOf.ts"],"names":[],"mappings":";;;AAAA,8CAAyC;AACzC,gDAA2C;AAC3C,0DAAqD;AACrD,oDAA+C;AAC/C,wDAAmD;AAEnD,SAAgB,iBAAiB,CAAC,KAAU,EAAE,SAAc;IAC1D,IAAA,qBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,EAAC,MAAM,EAAE,WAAW,EAAC,EAAE,EAAE;QACjD,MAAM,KAAK,GAAG,IAAA,yBAAW,EAAC,KAAK,CAAC,CAAC;QAEjC,IAAI,MAAM,KAAK,IAAA,iBAAO,EAAC,KAAK,CAAC,EAAE;YAC7B,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE;gBACxC,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,IAAI;gBAClB,KAAK,CAAC,GAAG,IAAW;oBAClB,OAAO,IAAA,yBAAW,EAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBAC5D,CAAC;aACF,CAAC,CAAC;YAEH,aAAK,CAAC,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;SACxD;QAED,MAAM,aAAa,GAAG,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,IAAA,2BAAY,EAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;QAEtF,IAAI,aAAa,EAAE;YACjB,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;SAC1D;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAtBD,8CAsBC","sourcesContent":["import {Store} from \"../../domain/Store\";\nimport {classOf} from \"../objects/classOf\";\nimport {descriptorOf} from \"../objects/descriptorOf\";\nimport {methodsOf} from \"../objects/methodsOf\";\nimport {prototypeOf} from \"../objects/prototypeOf\";\n\nexport function decorateMethodsOf(klass: any, decorator: any) {\n methodsOf(klass).forEach(({target, propertyKey}) => {\n const proto = prototypeOf(klass);\n\n if (target !== classOf(klass)) {\n Object.defineProperty(proto, propertyKey, {\n writable: true,\n configurable: true,\n value(...args: any[]) {\n return prototypeOf(target)[propertyKey].apply(this, args);\n }\n });\n\n Store.mergeStoreMethodFrom(klass, target, propertyKey);\n }\n\n const newDescriptor = decorator(proto, propertyKey, descriptorOf(klass, propertyKey));\n\n if (newDescriptor) {\n Object.defineProperty(proto, propertyKey, newDescriptor);\n }\n });\n}\n"]}
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
+
import { Store } from "../../domain/Store.js";
|
|
1
2
|
import { classOf } from "../objects/classOf.js";
|
|
3
|
+
import { descriptorOf } from "../objects/descriptorOf.js";
|
|
2
4
|
import { methodsOf } from "../objects/methodsOf.js";
|
|
3
5
|
import { prototypeOf } from "../objects/prototypeOf.js";
|
|
4
|
-
import { descriptorOf } from "../objects/descriptorOf.js";
|
|
5
|
-
import { Store } from "../../domain/Store.js";
|
|
6
6
|
export function decorateMethodsOf(klass, decorator) {
|
|
7
7
|
methodsOf(klass).forEach(({ target, propertyKey }) => {
|
|
8
|
+
const proto = prototypeOf(klass);
|
|
8
9
|
if (target !== classOf(klass)) {
|
|
9
|
-
Object.defineProperty(
|
|
10
|
+
Object.defineProperty(proto, propertyKey, {
|
|
10
11
|
writable: true,
|
|
12
|
+
configurable: true,
|
|
11
13
|
value(...args) {
|
|
12
14
|
return prototypeOf(target)[propertyKey].apply(this, args);
|
|
13
15
|
}
|
|
14
16
|
});
|
|
15
17
|
Store.mergeStoreMethodFrom(klass, target, propertyKey);
|
|
16
18
|
}
|
|
17
|
-
decorator(
|
|
19
|
+
const newDescriptor = decorator(proto, propertyKey, descriptorOf(klass, propertyKey));
|
|
20
|
+
if (newDescriptor) {
|
|
21
|
+
Object.defineProperty(proto, propertyKey, newDescriptor);
|
|
22
|
+
}
|
|
18
23
|
});
|
|
19
24
|
}
|
|
20
25
|
//# sourceMappingURL=decorateMethodsOf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorateMethodsOf.js","sourceRoot":"","sources":["../../../../src/utils/decorators/decorateMethodsOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"decorateMethodsOf.js","sourceRoot":"","sources":["../../../../src/utils/decorators/decorateMethodsOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAEnD,MAAM,UAAU,iBAAiB,CAAC,KAAU,EAAE,SAAc;IAC1D,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,EAAC,MAAM,EAAE,WAAW,EAAC,EAAE,EAAE;QACjD,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;QAEjC,IAAI,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,EAAE;YAC7B,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE;gBACxC,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,IAAI;gBAClB,KAAK,CAAC,GAAG,IAAW;oBAClB,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBAC5D,CAAC;aACF,CAAC,CAAC;YAEH,KAAK,CAAC,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;SACxD;QAED,MAAM,aAAa,GAAG,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;QAEtF,IAAI,aAAa,EAAE;YACjB,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;SAC1D;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Store} from \"../../domain/Store\";\nimport {classOf} from \"../objects/classOf\";\nimport {descriptorOf} from \"../objects/descriptorOf\";\nimport {methodsOf} from \"../objects/methodsOf\";\nimport {prototypeOf} from \"../objects/prototypeOf\";\n\nexport function decorateMethodsOf(klass: any, decorator: any) {\n methodsOf(klass).forEach(({target, propertyKey}) => {\n const proto = prototypeOf(klass);\n\n if (target !== classOf(klass)) {\n Object.defineProperty(proto, propertyKey, {\n writable: true,\n configurable: true,\n value(...args: any[]) {\n return prototypeOf(target)[propertyKey].apply(this, args);\n }\n });\n\n Store.mergeStoreMethodFrom(klass, target, propertyKey);\n }\n\n const newDescriptor = decorator(proto, propertyKey, descriptorOf(klass, propertyKey));\n\n if (newDescriptor) {\n Object.defineProperty(proto, propertyKey, newDescriptor);\n }\n });\n}\n"]}
|