@tsed/core 6.102.4 → 6.102.8-rc.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/jest.config.js +14 -0
- package/lib/cjs/decorators/configurable.js +2 -6
- package/lib/cjs/decorators/configurable.js.map +1 -1
- package/lib/cjs/decorators/deprecated.js.map +1 -1
- package/lib/cjs/decorators/enumerable.js +2 -6
- package/lib/cjs/decorators/enumerable.js.map +1 -1
- package/lib/cjs/decorators/notConfigurable.js +0 -4
- package/lib/cjs/decorators/notConfigurable.js.map +1 -1
- package/lib/cjs/decorators/notEnumerable.js +0 -4
- package/lib/cjs/decorators/notEnumerable.js.map +1 -1
- package/lib/cjs/decorators/readOnly.js +0 -4
- package/lib/cjs/decorators/readOnly.js.map +1 -1
- package/lib/cjs/decorators/writable.js +2 -6
- package/lib/cjs/decorators/writable.js.map +1 -1
- package/lib/cjs/errors/UnsupportedDecoratorType.js +5 -3
- package/lib/cjs/errors/UnsupportedDecoratorType.js.map +1 -1
- package/lib/cjs/index.js +80 -4
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/utils/objects/getConstructorArgNames.js +6 -1
- package/lib/cjs/utils/objects/getConstructorArgNames.js.map +1 -1
- package/lib/esm/decorators/configurable.js +1 -5
- package/lib/esm/decorators/configurable.js.map +1 -1
- package/lib/esm/decorators/deprecated.js.map +1 -1
- package/lib/esm/decorators/enumerable.js +1 -5
- package/lib/esm/decorators/enumerable.js.map +1 -1
- package/lib/esm/decorators/notConfigurable.js +1 -5
- package/lib/esm/decorators/notConfigurable.js.map +1 -1
- package/lib/esm/decorators/notEnumerable.js +1 -5
- package/lib/esm/decorators/notEnumerable.js.map +1 -1
- package/lib/esm/decorators/readOnly.js +1 -5
- package/lib/esm/decorators/readOnly.js.map +1 -1
- package/lib/esm/decorators/storeFn.js +1 -1
- package/lib/esm/decorators/storeMerge.js +1 -1
- package/lib/esm/decorators/storeSet.js +1 -1
- package/lib/esm/decorators/writable.js +1 -5
- package/lib/esm/decorators/writable.js.map +1 -1
- package/lib/esm/domain/AnyToPromise.js +3 -3
- package/lib/esm/domain/Metadata.js +1 -1
- package/lib/esm/domain/Store.js +8 -8
- package/lib/esm/errors/UnsupportedDecoratorType.js +3 -1
- package/lib/esm/errors/UnsupportedDecoratorType.js.map +1 -1
- package/lib/esm/index.js +81 -5
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/package.json +3 -0
- package/lib/esm/utils/decorators/decorateMethodsOf.js +5 -5
- package/lib/esm/utils/decorators/decoratorArgs.js +1 -1
- package/lib/esm/utils/decorators/decoratorTypeOf.js +2 -2
- package/lib/esm/utils/decorators/inheritedDescriptorOf.js +1 -1
- package/lib/esm/utils/decorators/useMethodDecorators.js +1 -1
- package/lib/esm/utils/objects/ancestorsOf.js +3 -3
- package/lib/esm/utils/objects/cleanObject.js +1 -1
- package/lib/esm/utils/objects/createInstance.js +1 -1
- package/lib/esm/utils/objects/deepClone.js +6 -6
- package/lib/esm/utils/objects/deepExtends.js +4 -4
- package/lib/esm/utils/objects/deepMerge.js +5 -5
- package/lib/esm/utils/objects/getClassOrSymbol.js +2 -2
- package/lib/esm/utils/objects/getConstructorArgNames.js +7 -2
- package/lib/esm/utils/objects/getConstructorArgNames.js.map +1 -1
- package/lib/esm/utils/objects/getEnumerableKeys.js +2 -2
- package/lib/esm/utils/objects/getValue.js +3 -3
- package/lib/esm/utils/objects/isArrowFn.js +1 -1
- package/lib/esm/utils/objects/isClass.js +7 -7
- package/lib/esm/utils/objects/isCollection.js +1 -1
- package/lib/esm/utils/objects/isEmpty.js +1 -1
- package/lib/esm/utils/objects/isEnumerable.js +2 -2
- package/lib/esm/utils/objects/isInheritedFrom.js +3 -3
- package/lib/esm/utils/objects/isPlainObject.js +1 -1
- package/lib/esm/utils/objects/isPrimitive.js +3 -3
- package/lib/esm/utils/objects/isSerializable.js +5 -5
- package/lib/esm/utils/objects/methodsOf.js +3 -3
- package/lib/esm/utils/objects/objectKeys.js +1 -1
- package/lib/esm/utils/objects/primitiveOf.js +3 -3
- package/lib/esm/utils/objects/prototypeOf.js +1 -1
- package/lib/esm/utils/objects/setValue.js +1 -1
- package/lib/esm/utils/objects/toMap.js +2 -2
- package/lib/esm/utils/objects/toStringConstructor.js +1 -1
- package/lib/esm/utils/proxyDelegation.js +1 -1
- package/lib/types/decorators/configurable.d.ts +0 -1
- package/lib/types/decorators/enumerable.d.ts +0 -1
- package/lib/types/decorators/notConfigurable.d.ts +0 -1
- package/lib/types/decorators/notEnumerable.d.ts +0 -1
- package/lib/types/decorators/readOnly.d.ts +0 -1
- package/lib/types/decorators/writable.d.ts +0 -1
- package/lib/types/index.d.ts +80 -5
- package/package.json +7 -4
- package/tsconfig.compile.esm.json +1 -1
- package/lib/cjs/decorators/index.js +0 -18
- package/lib/cjs/decorators/index.js.map +0 -1
- package/lib/cjs/domain/index.js +0 -11
- package/lib/cjs/domain/index.js.map +0 -1
- package/lib/cjs/interfaces/index.js +0 -3
- package/lib/cjs/interfaces/index.js.map +0 -1
- package/lib/cjs/utils/index.js +0 -19
- package/lib/cjs/utils/index.js.map +0 -1
- package/lib/cjs/utils/objects/index.js +0 -47
- package/lib/cjs/utils/objects/index.js.map +0 -1
- package/lib/esm/decorators/index.js +0 -15
- package/lib/esm/decorators/index.js.map +0 -1
- package/lib/esm/domain/index.js +0 -8
- package/lib/esm/domain/index.js.map +0 -1
- package/lib/esm/interfaces/index.js +0 -2
- package/lib/esm/interfaces/index.js.map +0 -1
- package/lib/esm/utils/index.js +0 -16
- package/lib/esm/utils/index.js.map +0 -1
- package/lib/esm/utils/objects/index.js +0 -44
- package/lib/esm/utils/objects/index.js.map +0 -1
- package/lib/types/decorators/index.d.ts +0 -14
- package/lib/types/domain/index.d.ts +0 -7
- package/lib/types/interfaces/index.d.ts +0 -4
- package/lib/types/utils/index.d.ts +0 -13
- package/lib/types/utils/objects/index.d.ts +0 -43
package/jest.config.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// For a detailed explanation regarding each configuration property, visit:
|
|
2
|
+
// https://jestjs.io/docs/en/configuration.html
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
...require("@tsed/jest-config")(__dirname, "core"),
|
|
6
|
+
coverageThreshold: {
|
|
7
|
+
global: {
|
|
8
|
+
statements: 97.95,
|
|
9
|
+
branches: 89.65,
|
|
10
|
+
functions: 96.04,
|
|
11
|
+
lines: 98.17
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Configurable = void 0;
|
|
4
|
-
|
|
5
|
-
* @module common/core
|
|
6
|
-
*/
|
|
7
|
-
const utils_1 = require("../utils");
|
|
8
|
-
/** */
|
|
4
|
+
const descriptorOf_1 = require("../utils/objects/descriptorOf");
|
|
9
5
|
function Configurable(value = true) {
|
|
10
6
|
return (target, propertyKey) => {
|
|
11
|
-
const descriptor = (0,
|
|
7
|
+
const descriptor = (0, descriptorOf_1.descriptorOf)(target, propertyKey) || { writable: true, enumerable: true };
|
|
12
8
|
descriptor.configurable = value;
|
|
13
9
|
Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);
|
|
14
10
|
return descriptor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurable.js","sourceRoot":"","sources":["../../../src/decorators/configurable.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"configurable.js","sourceRoot":"","sources":["../../../src/decorators/configurable.ts"],"names":[],"mappings":";;;AAAA,gEAA2D;AAE3D,SAAgB,YAAY,CAAC,QAAiB,IAAI;IAChD,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,IAAA,2BAAY,EAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;QAC3F,UAAU,CAAC,YAAY,GAAG,KAAK,CAAC;QAChC,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AARD,oCAQC","sourcesContent":["import {descriptorOf} from \"../utils/objects/descriptorOf\";\n\nexport function Configurable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {writable: true, enumerable: true};\n descriptor.configurable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../../src/decorators/deprecated.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../../src/decorators/deprecated.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,SAAgB,UAAU,CAAC,OAAe;IACxC,OAAO,CAAC,MAAiB,EAAE,SAAiB,EAAE,UAAwC,EAAE,EAAE;QACxF,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,UAAU,CAAC,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAEtD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AARD,gCAQC","sourcesContent":["import {deprecate} from \"util\";\nimport {Type} from \"../domain/Type\";\n/**\n * The `@Deprecated()` decorators wraps the given method in such a way that it is marked as deprecated.\n *\n * ```typescript\n * provide Foo {\n *\n * @Deprecated(\"Foo.method: Use Foo.method2 instead\")\n * public method() {\n *\n * }\n * ```\n *\n * When called, @Deprecated() will return a function that will emit a `DeprecationWarning` using the `process.on('warning')` event.\n * By default, this warning will be emitted and printed to `stderr` exactly once, the first time it is called. After the warning is emitted, the wrapped method is called.\n *\n * If either the `--no-deprecation` or `--no-warnings` command line flags are used, or if the `process.noDeprecation`\n * property is set to `true` prior to the first deprecation warning, the `@Deprecated()` decorators does nothing.\n *\n * If the `--trace-deprecation` or `--trace-warnings` command line flags are set, or the `process.traceDeprecation`\n * property is set to `true`, a warning and a stack trace are printed to stderr the first time the deprecated function is called.\n *\n * If the `--throw-deprecation` command line flag is set, or the `process.throwDeprecation` property is set to `true`,\n * then an exception will be thrown when the deprecated function is called.\n *\n * The `--throw-deprecation` command line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation`\n * and `process.traceDeprecation`.\n *\n * @param message\n * @returns {Function}\n * @decorator\n */\nexport function Deprecated(message: string): Function {\n return (target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<any>) => {\n const originalMethod = descriptor.value;\n\n descriptor.value = deprecate(originalMethod, message);\n\n return descriptor;\n };\n}\n"]}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Enumerable = void 0;
|
|
4
|
-
|
|
5
|
-
* @module common/core
|
|
6
|
-
*/
|
|
7
|
-
const utils_1 = require("../utils");
|
|
8
|
-
/** */
|
|
4
|
+
const descriptorOf_1 = require("../utils/objects/descriptorOf");
|
|
9
5
|
function Enumerable(value = true) {
|
|
10
6
|
return (target, propertyKey) => {
|
|
11
|
-
const descriptor = (0,
|
|
7
|
+
const descriptor = (0, descriptorOf_1.descriptorOf)(target, propertyKey) || { writable: true, configurable: true };
|
|
12
8
|
descriptor.enumerable = value;
|
|
13
9
|
Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);
|
|
14
10
|
return descriptor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enumerable.js","sourceRoot":"","sources":["../../../src/decorators/enumerable.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"enumerable.js","sourceRoot":"","sources":["../../../src/decorators/enumerable.ts"],"names":[],"mappings":";;;AAAA,gEAA2D;AAE3D,SAAgB,UAAU,CAAC,QAAiB,IAAI;IAC9C,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,IAAA,2BAAY,EAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC;QAC7F,UAAU,CAAC,UAAU,GAAG,KAAK,CAAC;QAC9B,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AARD,gCAQC","sourcesContent":["import {descriptorOf} from \"../utils/objects/descriptorOf\";\n\nexport function Enumerable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {writable: true, configurable: true};\n descriptor.enumerable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NotConfigurable = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @module common/core
|
|
6
|
-
*/
|
|
7
4
|
const configurable_1 = require("./configurable");
|
|
8
|
-
/** */
|
|
9
5
|
function NotConfigurable() {
|
|
10
6
|
return (0, configurable_1.Configurable)(false);
|
|
11
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notConfigurable.js","sourceRoot":"","sources":["../../../src/decorators/notConfigurable.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"notConfigurable.js","sourceRoot":"","sources":["../../../src/decorators/notConfigurable.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,SAAgB,eAAe;IAC7B,OAAO,IAAA,2BAAY,EAAC,KAAK,CAAC,CAAC;AAC7B,CAAC;AAFD,0CAEC","sourcesContent":["import {Configurable} from \"./configurable\";\n\nexport function NotConfigurable(): Function {\n return Configurable(false);\n}\n"]}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NotEnumerable = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @module common/core
|
|
6
|
-
*/
|
|
7
4
|
const enumerable_1 = require("./enumerable");
|
|
8
|
-
/** */
|
|
9
5
|
function NotEnumerable() {
|
|
10
6
|
return (0, enumerable_1.Enumerable)(false);
|
|
11
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notEnumerable.js","sourceRoot":"","sources":["../../../src/decorators/notEnumerable.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"notEnumerable.js","sourceRoot":"","sources":["../../../src/decorators/notEnumerable.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AAExC,SAAgB,aAAa;IAC3B,OAAO,IAAA,uBAAU,EAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAFD,sCAEC","sourcesContent":["import {Enumerable} from \"./enumerable\";\n\nexport function NotEnumerable(): Function {\n return Enumerable(false);\n}\n"]}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Readonly = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @module common/core
|
|
6
|
-
*/
|
|
7
4
|
const writable_1 = require("./writable");
|
|
8
|
-
/** */
|
|
9
5
|
function Readonly() {
|
|
10
6
|
return (0, writable_1.Writable)(false);
|
|
11
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readOnly.js","sourceRoot":"","sources":["../../../src/decorators/readOnly.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"readOnly.js","sourceRoot":"","sources":["../../../src/decorators/readOnly.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEpC,SAAgB,QAAQ;IACtB,OAAO,IAAA,mBAAQ,EAAC,KAAK,CAAC,CAAC;AACzB,CAAC;AAFD,4BAEC","sourcesContent":["import {Writable} from \"./writable\";\n\nexport function Readonly(): Function {\n return Writable(false);\n}\n"]}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Writable = void 0;
|
|
4
|
-
|
|
5
|
-
* @module common/core
|
|
6
|
-
*/
|
|
7
|
-
const utils_1 = require("../utils");
|
|
8
|
-
/** */
|
|
4
|
+
const descriptorOf_1 = require("../utils/objects/descriptorOf");
|
|
9
5
|
function Writable(value = true) {
|
|
10
6
|
return (target, propertyKey) => {
|
|
11
|
-
const descriptor = (0,
|
|
7
|
+
const descriptor = (0, descriptorOf_1.descriptorOf)(target, propertyKey) || { configurable: true, enumerable: true };
|
|
12
8
|
descriptor.writable = value;
|
|
13
9
|
Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);
|
|
14
10
|
return descriptor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writable.js","sourceRoot":"","sources":["../../../src/decorators/writable.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"writable.js","sourceRoot":"","sources":["../../../src/decorators/writable.ts"],"names":[],"mappings":";;;AAAA,gEAA2D;AAE3D,SAAgB,QAAQ,CAAC,QAAiB,IAAI;IAC5C,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,IAAA,2BAAY,EAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;QAC/F,UAAU,CAAC,QAAQ,GAAG,KAAK,CAAC;QAC5B,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AARD,4BAQC","sourcesContent":["import {descriptorOf} from \"../utils/objects/descriptorOf\";\n\nexport function Writable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {configurable: true, enumerable: true};\n descriptor.writable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UnsupportedDecoratorType = void 0;
|
|
4
|
-
const
|
|
4
|
+
const decoratorTypeOf_1 = require("../utils/decorators/decoratorTypeOf");
|
|
5
|
+
const classOf_1 = require("../utils/objects/classOf");
|
|
6
|
+
const nameOf_1 = require("../utils/objects/nameOf");
|
|
5
7
|
class UnsupportedDecoratorType extends Error {
|
|
6
8
|
constructor(decorator, args) {
|
|
7
9
|
super(UnsupportedDecoratorType.buildMessage(decorator, args));
|
|
8
10
|
}
|
|
9
11
|
static buildMessage(decorator, args) {
|
|
10
12
|
const [target, propertyKey, index] = args;
|
|
11
|
-
const bindingType = (0,
|
|
13
|
+
const bindingType = (0, decoratorTypeOf_1.decoratorTypeOf)(args);
|
|
12
14
|
const shortBinding = bindingType.split("/")[0];
|
|
13
15
|
const param = shortBinding === "parameter" ? ".[" + index + "]" : "";
|
|
14
16
|
const cstr = shortBinding === "parameter" ? ".constructor" : "";
|
|
15
17
|
const method = propertyKey ? "." + propertyKey : cstr;
|
|
16
|
-
const path = (0,
|
|
18
|
+
const path = (0, nameOf_1.nameOf)((0, classOf_1.classOf)(target)) + method + param;
|
|
17
19
|
return `${decorator.name} cannot be used as ${bindingType} decorator on ${path}`;
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnsupportedDecoratorType.js","sourceRoot":"","sources":["../../../src/errors/UnsupportedDecoratorType.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"UnsupportedDecoratorType.js","sourceRoot":"","sources":["../../../src/errors/UnsupportedDecoratorType.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AACpE,sDAAiD;AACjD,oDAA+C;AAE/C,MAAa,wBAAyB,SAAQ,KAAK;IAGjD,YAAY,SAAc,EAAE,IAAW;QACrC,KAAK,CAAC,wBAAwB,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IAChE,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,SAAc,EAAE,IAAW;QACrD,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;QAE1C,MAAM,WAAW,GAAG,IAAA,iCAAe,EAAC,IAAI,CAAC,CAAC;QAC1C,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,MAAM,IAAI,GAAG,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;QAEtD,MAAM,IAAI,GAAG,IAAA,eAAM,EAAC,IAAA,iBAAO,EAAC,MAAM,CAAC,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC;QAEtD,OAAO,GAAG,SAAS,CAAC,IAAI,sBAAsB,WAAW,iBAAiB,IAAI,EAAE,CAAC;IACnF,CAAC;CACF;AApBD,4DAoBC","sourcesContent":["import {decoratorTypeOf} from \"../utils/decorators/decoratorTypeOf\";\nimport {classOf} from \"../utils/objects/classOf\";\nimport {nameOf} from \"../utils/objects/nameOf\";\n\nexport class UnsupportedDecoratorType extends Error {\n name: \"UNSUPPORTED_DECORATOR_TYPE\";\n\n constructor(decorator: any, args: any[]) {\n super(UnsupportedDecoratorType.buildMessage(decorator, args));\n }\n\n private static buildMessage(decorator: any, args: any[]): string {\n const [target, propertyKey, index] = args;\n\n const bindingType = decoratorTypeOf(args);\n const shortBinding = bindingType.split(\"/\")[0];\n const param = shortBinding === \"parameter\" ? \".[\" + index + \"]\" : \"\";\n const cstr = shortBinding === \"parameter\" ? \".constructor\" : \"\";\n const method = propertyKey ? \".\" + propertyKey : cstr;\n\n const path = nameOf(classOf(target)) + method + param;\n\n return `${decorator.name} cannot be used as ${bindingType} decorator on ${path}`;\n }\n}\n"]}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,9 +1,85 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file Automatically generated by barrelsby.
|
|
4
|
+
*/
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const tslib_1 = require("tslib");
|
|
4
|
-
require("
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./
|
|
7
|
+
(0, tslib_1.__exportStar)(require("./decorators/configurable"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./decorators/deprecated"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./decorators/enumerable"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./decorators/notConfigurable"), exports);
|
|
11
|
+
(0, tslib_1.__exportStar)(require("./decorators/notEnumerable"), exports);
|
|
12
|
+
(0, tslib_1.__exportStar)(require("./decorators/readOnly"), exports);
|
|
13
|
+
(0, tslib_1.__exportStar)(require("./decorators/storeFn"), exports);
|
|
14
|
+
(0, tslib_1.__exportStar)(require("./decorators/storeMerge"), exports);
|
|
15
|
+
(0, tslib_1.__exportStar)(require("./decorators/storeSet"), exports);
|
|
16
|
+
(0, tslib_1.__exportStar)(require("./decorators/writable"), exports);
|
|
17
|
+
(0, tslib_1.__exportStar)(require("./domain/AnyToPromise"), exports);
|
|
18
|
+
(0, tslib_1.__exportStar)(require("./domain/DecoratorTypes"), exports);
|
|
19
|
+
(0, tslib_1.__exportStar)(require("./domain/Env"), exports);
|
|
20
|
+
(0, tslib_1.__exportStar)(require("./domain/Hooks"), exports);
|
|
21
|
+
(0, tslib_1.__exportStar)(require("./domain/Metadata"), exports);
|
|
22
|
+
(0, tslib_1.__exportStar)(require("./domain/Store"), exports);
|
|
23
|
+
(0, tslib_1.__exportStar)(require("./domain/Type"), exports);
|
|
7
24
|
(0, tslib_1.__exportStar)(require("./errors/UnsupportedDecoratorType"), exports);
|
|
8
|
-
(0, tslib_1.__exportStar)(require("./
|
|
25
|
+
(0, tslib_1.__exportStar)(require("./interfaces/AnyDecorator"), exports);
|
|
26
|
+
(0, tslib_1.__exportStar)(require("./interfaces/DecoratorParameters"), exports);
|
|
27
|
+
(0, tslib_1.__exportStar)(require("./interfaces/HashOf"), exports);
|
|
28
|
+
(0, tslib_1.__exportStar)(require("./interfaces/MetadataTypes"), exports);
|
|
29
|
+
(0, tslib_1.__exportStar)(require("./interfaces/ValueOf"), exports);
|
|
30
|
+
(0, tslib_1.__exportStar)(require("./utils/catchError"), exports);
|
|
31
|
+
(0, tslib_1.__exportStar)(require("./utils/proxyDelegation"), exports);
|
|
32
|
+
(0, tslib_1.__exportStar)(require("./utils/uniq"), exports);
|
|
33
|
+
(0, tslib_1.__exportStar)(require("./utils/decorators/decorateMethodsOf"), exports);
|
|
34
|
+
(0, tslib_1.__exportStar)(require("./utils/decorators/decoratorArgs"), exports);
|
|
35
|
+
(0, tslib_1.__exportStar)(require("./utils/decorators/decoratorTypeOf"), exports);
|
|
36
|
+
(0, tslib_1.__exportStar)(require("./utils/decorators/inheritedDescriptorOf"), exports);
|
|
37
|
+
(0, tslib_1.__exportStar)(require("./utils/decorators/useDecorators"), exports);
|
|
38
|
+
(0, tslib_1.__exportStar)(require("./utils/decorators/useMethodDecorators"), exports);
|
|
39
|
+
(0, tslib_1.__exportStar)(require("./utils/http/getHostInfoFromPort"), exports);
|
|
40
|
+
(0, tslib_1.__exportStar)(require("./utils/imports/importPackage"), exports);
|
|
41
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/ancestorOf"), exports);
|
|
42
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/ancestorsOf"), exports);
|
|
43
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/classOf"), exports);
|
|
44
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/cleanObject"), exports);
|
|
45
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/constructorOf"), exports);
|
|
46
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/createInstance"), exports);
|
|
47
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/deepClone"), exports);
|
|
48
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/deepExtends"), exports);
|
|
49
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/deepMerge"), exports);
|
|
50
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/descriptorOf"), exports);
|
|
51
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/getClassOrSymbol"), exports);
|
|
52
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/getConstructorArgNames"), exports);
|
|
53
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/getEnumerableKeys"), exports);
|
|
54
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/getValue"), exports);
|
|
55
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isArray"), exports);
|
|
56
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isArrowFn"), exports);
|
|
57
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isBoolean"), exports);
|
|
58
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isClass"), exports);
|
|
59
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isCollection"), exports);
|
|
60
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isDate"), exports);
|
|
61
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isEmpty"), exports);
|
|
62
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isEnumerable"), exports);
|
|
63
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isFunction"), exports);
|
|
64
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isInheritedFrom"), exports);
|
|
65
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isNil"), exports);
|
|
66
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isNumber"), exports);
|
|
67
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isObject"), exports);
|
|
68
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isObservable"), exports);
|
|
69
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isPlainObject"), exports);
|
|
70
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isPrimitive"), exports);
|
|
71
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isPromise"), exports);
|
|
72
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isProtectedKey"), exports);
|
|
73
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isSerializable"), exports);
|
|
74
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isStream"), exports);
|
|
75
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isString"), exports);
|
|
76
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/isSymbol"), exports);
|
|
77
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/methodsOf"), exports);
|
|
78
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/nameOf"), exports);
|
|
79
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/objectKeys"), exports);
|
|
80
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/primitiveOf"), exports);
|
|
81
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/prototypeOf"), exports);
|
|
82
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/setValue"), exports);
|
|
83
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/toMap"), exports);
|
|
84
|
+
(0, tslib_1.__exportStar)(require("./utils/objects/toStringConstructor"), exports);
|
|
9
85
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,yEAA0C;AAC1C,uEAAwC;AACxC,uEAAwC;AACxC,4EAA6C;AAC7C,0EAA2C;AAC3C,qEAAsC;AACtC,oEAAqC;AACrC,uEAAwC;AACxC,qEAAsC;AACtC,qEAAsC;AACtC,qEAAsC;AACtC,uEAAwC;AACxC,4DAA6B;AAC7B,8DAA+B;AAC/B,iEAAkC;AAClC,8DAA+B;AAC/B,6DAA8B;AAC9B,iFAAkD;AAClD,yEAA0C;AAC1C,gFAAiD;AACjD,mEAAoC;AACpC,0EAA2C;AAC3C,oEAAqC;AACrC,kEAAmC;AACnC,uEAAwC;AACxC,4DAA6B;AAC7B,oFAAqD;AACrD,gFAAiD;AACjD,kFAAmD;AACnD,wFAAyD;AACzD,gFAAiD;AACjD,sFAAuD;AACvD,gFAAiD;AACjD,6EAA8C;AAC9C,0EAA2C;AAC3C,2EAA4C;AAC5C,uEAAwC;AACxC,2EAA4C;AAC5C,6EAA8C;AAC9C,8EAA+C;AAC/C,yEAA0C;AAC1C,2EAA4C;AAC5C,yEAA0C;AAC1C,4EAA6C;AAC7C,gFAAiD;AACjD,sFAAuD;AACvD,iFAAkD;AAClD,wEAAyC;AACzC,uEAAwC;AACxC,yEAA0C;AAC1C,yEAA0C;AAC1C,uEAAwC;AACxC,4EAA6C;AAC7C,sEAAuC;AACvC,uEAAwC;AACxC,4EAA6C;AAC7C,0EAA2C;AAC3C,+EAAgD;AAChD,qEAAsC;AACtC,wEAAyC;AACzC,wEAAyC;AACzC,4EAA6C;AAC7C,6EAA8C;AAC9C,2EAA4C;AAC5C,yEAA0C;AAC1C,8EAA+C;AAC/C,8EAA+C;AAC/C,wEAAyC;AACzC,wEAAyC;AACzC,wEAAyC;AACzC,yEAA0C;AAC1C,sEAAuC;AACvC,0EAA2C;AAC3C,2EAA4C;AAC5C,2EAA4C;AAC5C,wEAAyC;AACzC,qEAAsC;AACtC,mFAAoD","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./decorators/configurable\";\nexport * from \"./decorators/deprecated\";\nexport * from \"./decorators/enumerable\";\nexport * from \"./decorators/notConfigurable\";\nexport * from \"./decorators/notEnumerable\";\nexport * from \"./decorators/readOnly\";\nexport * from \"./decorators/storeFn\";\nexport * from \"./decorators/storeMerge\";\nexport * from \"./decorators/storeSet\";\nexport * from \"./decorators/writable\";\nexport * from \"./domain/AnyToPromise\";\nexport * from \"./domain/DecoratorTypes\";\nexport * from \"./domain/Env\";\nexport * from \"./domain/Hooks\";\nexport * from \"./domain/Metadata\";\nexport * from \"./domain/Store\";\nexport * from \"./domain/Type\";\nexport * from \"./errors/UnsupportedDecoratorType\";\nexport * from \"./interfaces/AnyDecorator\";\nexport * from \"./interfaces/DecoratorParameters\";\nexport * from \"./interfaces/HashOf\";\nexport * from \"./interfaces/MetadataTypes\";\nexport * from \"./interfaces/ValueOf\";\nexport * from \"./utils/catchError\";\nexport * from \"./utils/proxyDelegation\";\nexport * from \"./utils/uniq\";\nexport * from \"./utils/decorators/decorateMethodsOf\";\nexport * from \"./utils/decorators/decoratorArgs\";\nexport * from \"./utils/decorators/decoratorTypeOf\";\nexport * from \"./utils/decorators/inheritedDescriptorOf\";\nexport * from \"./utils/decorators/useDecorators\";\nexport * from \"./utils/decorators/useMethodDecorators\";\nexport * from \"./utils/http/getHostInfoFromPort\";\nexport * from \"./utils/imports/importPackage\";\nexport * from \"./utils/objects/ancestorOf\";\nexport * from \"./utils/objects/ancestorsOf\";\nexport * from \"./utils/objects/classOf\";\nexport * from \"./utils/objects/cleanObject\";\nexport * from \"./utils/objects/constructorOf\";\nexport * from \"./utils/objects/createInstance\";\nexport * from \"./utils/objects/deepClone\";\nexport * from \"./utils/objects/deepExtends\";\nexport * from \"./utils/objects/deepMerge\";\nexport * from \"./utils/objects/descriptorOf\";\nexport * from \"./utils/objects/getClassOrSymbol\";\nexport * from \"./utils/objects/getConstructorArgNames\";\nexport * from \"./utils/objects/getEnumerableKeys\";\nexport * from \"./utils/objects/getValue\";\nexport * from \"./utils/objects/isArray\";\nexport * from \"./utils/objects/isArrowFn\";\nexport * from \"./utils/objects/isBoolean\";\nexport * from \"./utils/objects/isClass\";\nexport * from \"./utils/objects/isCollection\";\nexport * from \"./utils/objects/isDate\";\nexport * from \"./utils/objects/isEmpty\";\nexport * from \"./utils/objects/isEnumerable\";\nexport * from \"./utils/objects/isFunction\";\nexport * from \"./utils/objects/isInheritedFrom\";\nexport * from \"./utils/objects/isNil\";\nexport * from \"./utils/objects/isNumber\";\nexport * from \"./utils/objects/isObject\";\nexport * from \"./utils/objects/isObservable\";\nexport * from \"./utils/objects/isPlainObject\";\nexport * from \"./utils/objects/isPrimitive\";\nexport * from \"./utils/objects/isPromise\";\nexport * from \"./utils/objects/isProtectedKey\";\nexport * from \"./utils/objects/isSerializable\";\nexport * from \"./utils/objects/isStream\";\nexport * from \"./utils/objects/isString\";\nexport * from \"./utils/objects/isSymbol\";\nexport * from \"./utils/objects/methodsOf\";\nexport * from \"./utils/objects/nameOf\";\nexport * from \"./utils/objects/objectKeys\";\nexport * from \"./utils/objects/primitiveOf\";\nexport * from \"./utils/objects/prototypeOf\";\nexport * from \"./utils/objects/setValue\";\nexport * from \"./utils/objects/toMap\";\nexport * from \"./utils/objects/toStringConstructor\";\n"]}
|
|
@@ -3,7 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getConstructorArgNames = void 0;
|
|
4
4
|
const toStringConstructor_1 = require("./toStringConstructor");
|
|
5
5
|
function getConstructorArgNames(target) {
|
|
6
|
-
return (0, toStringConstructor_1.toStringConstructor)(target)
|
|
6
|
+
return (0, toStringConstructor_1.toStringConstructor)(target)
|
|
7
|
+
.split("constructor(")[1]
|
|
8
|
+
.split(")")[0]
|
|
9
|
+
.split(", ")
|
|
10
|
+
.filter(Boolean)
|
|
11
|
+
.map((s) => s.trim());
|
|
7
12
|
}
|
|
8
13
|
exports.getConstructorArgNames = getConstructorArgNames;
|
|
9
14
|
//# sourceMappingURL=getConstructorArgNames.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConstructorArgNames.js","sourceRoot":"","sources":["../../../../src/utils/objects/getConstructorArgNames.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAE1D,SAAgB,sBAAsB,CAAC,MAAW;IAChD,OAAO,IAAA,yCAAmB,EAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"getConstructorArgNames.js","sourceRoot":"","sources":["../../../../src/utils/objects/getConstructorArgNames.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAE1D,SAAgB,sBAAsB,CAAC,MAAW;IAChD,OAAO,IAAA,yCAAmB,EAAC,MAAM,CAAC;SAC/B,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;SACxB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACb,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAC1B,CAAC;AAPD,wDAOC","sourcesContent":["import {toStringConstructor} from \"./toStringConstructor\";\n\nexport function getConstructorArgNames(target: any) {\n return toStringConstructor(target)\n .split(\"constructor(\")[1]\n .split(\")\")[0]\n .split(\", \")\n .filter(Boolean)\n .map((s) => s.trim());\n}\n"]}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @module common/core
|
|
3
|
-
*/
|
|
4
|
-
import { descriptorOf } from "../utils";
|
|
5
|
-
/** */
|
|
1
|
+
import { descriptorOf } from "../utils/objects/descriptorOf.js";
|
|
6
2
|
export function Configurable(value = true) {
|
|
7
3
|
return (target, propertyKey) => {
|
|
8
4
|
const descriptor = descriptorOf(target, propertyKey) || { writable: true, enumerable: true };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurable.js","sourceRoot":"","sources":["../../../src/decorators/configurable.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"configurable.js","sourceRoot":"","sources":["../../../src/decorators/configurable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAE3D,MAAM,UAAU,YAAY,CAAC,QAAiB,IAAI;IAChD,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;QAC3F,UAAU,CAAC,YAAY,GAAG,KAAK,CAAC;QAChC,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {descriptorOf} from \"../utils/objects/descriptorOf\";\n\nexport function Configurable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {writable: true, enumerable: true};\n descriptor.configurable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../../src/decorators/deprecated.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../../src/decorators/deprecated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,MAAM,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,OAAO,CAAC,MAAiB,EAAE,SAAiB,EAAE,UAAwC,EAAE,EAAE;QACxF,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,UAAU,CAAC,KAAK,GAAG,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAEtD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {deprecate} from \"util\";\nimport {Type} from \"../domain/Type\";\n/**\n * The `@Deprecated()` decorators wraps the given method in such a way that it is marked as deprecated.\n *\n * ```typescript\n * provide Foo {\n *\n * @Deprecated(\"Foo.method: Use Foo.method2 instead\")\n * public method() {\n *\n * }\n * ```\n *\n * When called, @Deprecated() will return a function that will emit a `DeprecationWarning` using the `process.on('warning')` event.\n * By default, this warning will be emitted and printed to `stderr` exactly once, the first time it is called. After the warning is emitted, the wrapped method is called.\n *\n * If either the `--no-deprecation` or `--no-warnings` command line flags are used, or if the `process.noDeprecation`\n * property is set to `true` prior to the first deprecation warning, the `@Deprecated()` decorators does nothing.\n *\n * If the `--trace-deprecation` or `--trace-warnings` command line flags are set, or the `process.traceDeprecation`\n * property is set to `true`, a warning and a stack trace are printed to stderr the first time the deprecated function is called.\n *\n * If the `--throw-deprecation` command line flag is set, or the `process.throwDeprecation` property is set to `true`,\n * then an exception will be thrown when the deprecated function is called.\n *\n * The `--throw-deprecation` command line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation`\n * and `process.traceDeprecation`.\n *\n * @param message\n * @returns {Function}\n * @decorator\n */\nexport function Deprecated(message: string): Function {\n return (target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<any>) => {\n const originalMethod = descriptor.value;\n\n descriptor.value = deprecate(originalMethod, message);\n\n return descriptor;\n };\n}\n"]}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @module common/core
|
|
3
|
-
*/
|
|
4
|
-
import { descriptorOf } from "../utils";
|
|
5
|
-
/** */
|
|
1
|
+
import { descriptorOf } from "../utils/objects/descriptorOf.js";
|
|
6
2
|
export function Enumerable(value = true) {
|
|
7
3
|
return (target, propertyKey) => {
|
|
8
4
|
const descriptor = descriptorOf(target, propertyKey) || { writable: true, configurable: true };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enumerable.js","sourceRoot":"","sources":["../../../src/decorators/enumerable.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"enumerable.js","sourceRoot":"","sources":["../../../src/decorators/enumerable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAE3D,MAAM,UAAU,UAAU,CAAC,QAAiB,IAAI;IAC9C,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC;QAC7F,UAAU,CAAC,UAAU,GAAG,KAAK,CAAC;QAC9B,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {descriptorOf} from \"../utils/objects/descriptorOf\";\n\nexport function Enumerable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {writable: true, configurable: true};\n descriptor.enumerable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notConfigurable.js","sourceRoot":"","sources":["../../../src/decorators/notConfigurable.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"notConfigurable.js","sourceRoot":"","sources":["../../../src/decorators/notConfigurable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,eAAe;IAC7B,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["import {Configurable} from \"./configurable\";\n\nexport function NotConfigurable(): Function {\n return Configurable(false);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notEnumerable.js","sourceRoot":"","sources":["../../../src/decorators/notEnumerable.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"notEnumerable.js","sourceRoot":"","sources":["../../../src/decorators/notEnumerable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,MAAM,UAAU,aAAa;IAC3B,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import {Enumerable} from \"./enumerable\";\n\nexport function NotEnumerable(): Function {\n return Enumerable(false);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readOnly.js","sourceRoot":"","sources":["../../../src/decorators/readOnly.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"readOnly.js","sourceRoot":"","sources":["../../../src/decorators/readOnly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,UAAU,QAAQ;IACtB,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC","sourcesContent":["import {Writable} from \"./writable\";\n\nexport function Readonly(): Function {\n return Writable(false);\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Store } from "../domain/Store";
|
|
1
|
+
import { Store } from "../domain/Store.js";
|
|
2
2
|
/**
|
|
3
3
|
* Create a store correctly configured from the parameters given by the decorator.
|
|
4
4
|
* The `fn` can return a decorator that will be initialized with the parameters (target, propertyKey, descriptor).
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @module common/core
|
|
3
|
-
*/
|
|
4
|
-
import { descriptorOf } from "../utils";
|
|
5
|
-
/** */
|
|
1
|
+
import { descriptorOf } from "../utils/objects/descriptorOf.js";
|
|
6
2
|
export function Writable(value = true) {
|
|
7
3
|
return (target, propertyKey) => {
|
|
8
4
|
const descriptor = descriptorOf(target, propertyKey) || { configurable: true, enumerable: true };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writable.js","sourceRoot":"","sources":["../../../src/decorators/writable.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"writable.js","sourceRoot":"","sources":["../../../src/decorators/writable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAE3D,MAAM,UAAU,QAAQ,CAAC,QAAiB,IAAI;IAC5C,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;QAC/F,UAAU,CAAC,QAAQ,GAAG,KAAK,CAAC;QAC5B,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {descriptorOf} from \"../utils/objects/descriptorOf\";\n\nexport function Writable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {configurable: true, enumerable: true};\n descriptor.writable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _AnyToPromise_resolves, _AnyToPromise_rejects, _AnyToPromise_hasNextFunction, _AnyToPromise_promise;
|
|
2
2
|
import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
3
|
-
import { isObservable } from "../utils/objects/isObservable";
|
|
4
|
-
import { isPromise } from "../utils/objects/isPromise";
|
|
5
|
-
import { isStream } from "../utils/objects/isStream";
|
|
3
|
+
import { isObservable } from "../utils/objects/isObservable.js";
|
|
4
|
+
import { isPromise } from "../utils/objects/isPromise.js";
|
|
5
|
+
import { isStream } from "../utils/objects/isStream.js";
|
|
6
6
|
/**
|
|
7
7
|
* @ignore
|
|
8
8
|
*/
|
package/lib/esm/domain/Store.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DecoratorTypes } from "../domain/DecoratorTypes";
|
|
2
|
-
import { decoratorTypeOf } from "../utils/decorators/decoratorTypeOf";
|
|
3
|
-
import { deepClone } from "../utils/objects/deepClone";
|
|
4
|
-
import { deepMerge } from "../utils/objects/deepMerge";
|
|
5
|
-
import { descriptorOf } from "../utils/objects/descriptorOf";
|
|
6
|
-
import { isSymbol } from "../utils/objects/isSymbol";
|
|
7
|
-
import { nameOf } from "../utils/objects/nameOf";
|
|
8
|
-
import { Metadata } from "./Metadata";
|
|
1
|
+
import { DecoratorTypes } from "../domain/DecoratorTypes.js";
|
|
2
|
+
import { decoratorTypeOf } from "../utils/decorators/decoratorTypeOf.js";
|
|
3
|
+
import { deepClone } from "../utils/objects/deepClone.js";
|
|
4
|
+
import { deepMerge } from "../utils/objects/deepMerge.js";
|
|
5
|
+
import { descriptorOf } from "../utils/objects/descriptorOf.js";
|
|
6
|
+
import { isSymbol } from "../utils/objects/isSymbol.js";
|
|
7
|
+
import { nameOf } from "../utils/objects/nameOf.js";
|
|
8
|
+
import { Metadata } from "./Metadata.js";
|
|
9
9
|
/**
|
|
10
10
|
* @ignore
|
|
11
11
|
*/
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { decoratorTypeOf } from "../utils/decorators/decoratorTypeOf.js";
|
|
2
|
+
import { classOf } from "../utils/objects/classOf.js";
|
|
3
|
+
import { nameOf } from "../utils/objects/nameOf.js";
|
|
2
4
|
export class UnsupportedDecoratorType extends Error {
|
|
3
5
|
constructor(decorator, args) {
|
|
4
6
|
super(UnsupportedDecoratorType.buildMessage(decorator, args));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnsupportedDecoratorType.js","sourceRoot":"","sources":["../../../src/errors/UnsupportedDecoratorType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"UnsupportedDecoratorType.js","sourceRoot":"","sources":["../../../src/errors/UnsupportedDecoratorType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAE/C,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IAGjD,YAAY,SAAc,EAAE,IAAW;QACrC,KAAK,CAAC,wBAAwB,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IAChE,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,SAAc,EAAE,IAAW;QACrD,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;QAE1C,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QAC1C,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,MAAM,IAAI,GAAG,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;QAEtD,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC;QAEtD,OAAO,GAAG,SAAS,CAAC,IAAI,sBAAsB,WAAW,iBAAiB,IAAI,EAAE,CAAC;IACnF,CAAC;CACF","sourcesContent":["import {decoratorTypeOf} from \"../utils/decorators/decoratorTypeOf\";\nimport {classOf} from \"../utils/objects/classOf\";\nimport {nameOf} from \"../utils/objects/nameOf\";\n\nexport class UnsupportedDecoratorType extends Error {\n name: \"UNSUPPORTED_DECORATOR_TYPE\";\n\n constructor(decorator: any, args: any[]) {\n super(UnsupportedDecoratorType.buildMessage(decorator, args));\n }\n\n private static buildMessage(decorator: any, args: any[]): string {\n const [target, propertyKey, index] = args;\n\n const bindingType = decoratorTypeOf(args);\n const shortBinding = bindingType.split(\"/\")[0];\n const param = shortBinding === \"parameter\" ? \".[\" + index + \"]\" : \"\";\n const cstr = shortBinding === \"parameter\" ? \".constructor\" : \"\";\n const method = propertyKey ? \".\" + propertyKey : cstr;\n\n const path = nameOf(classOf(target)) + method + param;\n\n return `${decorator.name} cannot be used as ${bindingType} decorator on ${path}`;\n }\n}\n"]}
|