@tsed/core 6.102.3 → 6.102.4
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,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Deprecated = void 0;
|
|
4
|
+
const util_1 = require("util");
|
|
4
5
|
/**
|
|
5
6
|
* The `@Deprecated()` decorators wraps the given method in such a way that it is marked as deprecated.
|
|
6
7
|
*
|
|
@@ -35,7 +36,7 @@ exports.Deprecated = void 0;
|
|
|
35
36
|
function Deprecated(message) {
|
|
36
37
|
return (target, targetKey, descriptor) => {
|
|
37
38
|
const originalMethod = descriptor.value;
|
|
38
|
-
descriptor.value =
|
|
39
|
+
descriptor.value = (0, util_1.deprecate)(originalMethod, message);
|
|
39
40
|
return descriptor;
|
|
40
41
|
};
|
|
41
42
|
}
|
|
@@ -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":";;;AACA,+BAA+B;AAC/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 {Type} from \"../domain/Type\";\nimport {deprecate} from \"util\";\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,3 +1,4 @@
|
|
|
1
|
+
import { deprecate } from "util";
|
|
1
2
|
/**
|
|
2
3
|
* The `@Deprecated()` decorators wraps the given method in such a way that it is marked as deprecated.
|
|
3
4
|
*
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
export function Deprecated(message) {
|
|
33
34
|
return (target, targetKey, descriptor) => {
|
|
34
35
|
const originalMethod = descriptor.value;
|
|
35
|
-
descriptor.value =
|
|
36
|
+
descriptor.value = deprecate(originalMethod, message);
|
|
36
37
|
return descriptor;
|
|
37
38
|
};
|
|
38
39
|
}
|
|
@@ -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":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,MAAM,CAAC;AAC/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 {Type} from \"../domain/Type\";\nimport {deprecate} from \"util\";\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"]}
|