@tsed/core 7.41.1 → 7.42.0
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 +4 -4
- package/lib/browser/core.umd.min.js +1 -1
- package/lib/browser/core.umd.min.js.map +1 -1
- package/lib/cjs/decorators/deprecated.js +29 -2
- package/lib/cjs/decorators/deprecated.js.map +1 -1
- package/lib/cjs/utils/objects/isBuffer.js +10 -2
- package/lib/cjs/utils/objects/isBuffer.js.map +1 -1
- package/lib/esm/decorators/deprecated.js +28 -1
- package/lib/esm/decorators/deprecated.js.map +1 -1
- package/lib/esm/utils/objects/isBuffer.js +8 -1
- package/lib/esm/utils/objects/isBuffer.js.map +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/utils/objects/isBuffer.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Deprecated = void 0;
|
|
4
|
-
|
|
4
|
+
function deprecate(fn, msg) {
|
|
5
|
+
if (typeof process !== "undefined" && process.noDeprecation === true) {
|
|
6
|
+
return fn;
|
|
7
|
+
}
|
|
8
|
+
// Allow for deprecating things in the process of starting up.
|
|
9
|
+
if (typeof process === "undefined") {
|
|
10
|
+
return function (...args) {
|
|
11
|
+
return deprecate(fn, msg).apply(this, args);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
let warned = false;
|
|
15
|
+
function deprecated(...args) {
|
|
16
|
+
if (!warned) {
|
|
17
|
+
if (process.throwDeprecation) {
|
|
18
|
+
throw new Error(msg);
|
|
19
|
+
}
|
|
20
|
+
else if (process.traceDeprecation) {
|
|
21
|
+
console.trace(msg);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
console.error(msg);
|
|
25
|
+
}
|
|
26
|
+
warned = true;
|
|
27
|
+
}
|
|
28
|
+
return fn.apply(this, args);
|
|
29
|
+
}
|
|
30
|
+
return deprecated;
|
|
31
|
+
}
|
|
5
32
|
/**
|
|
6
33
|
* The `@Deprecated()` decorators wraps the given method in such a way that it is marked as deprecated.
|
|
7
34
|
*
|
|
@@ -36,7 +63,7 @@ const util_1 = require("util");
|
|
|
36
63
|
function Deprecated(message) {
|
|
37
64
|
return (target, targetKey, descriptor) => {
|
|
38
65
|
const originalMethod = descriptor.value;
|
|
39
|
-
descriptor.value =
|
|
66
|
+
descriptor.value = deprecate(originalMethod, message);
|
|
40
67
|
return descriptor;
|
|
41
68
|
};
|
|
42
69
|
}
|
|
@@ -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":";;;AAEA,SAAS,SAAS,CAAC,EAAO,EAAE,GAAW;IACrC,IAAI,OAAO,OAAO,KAAK,WAAW,IAAK,OAAe,CAAC,aAAa,KAAK,IAAI,EAAE;QAC7E,OAAO,EAAE,CAAC;KACX;IAED,8DAA8D;IAC9D,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QAClC,OAAO,UAAU,GAAG,IAAW;YAC7B,OAAO,SAAS,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC,CAAC;KACH;IAED,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,SAAS,UAAU,CAAC,GAAG,IAAW;QAChC,IAAI,CAAC,MAAM,EAAE;YACX,IAAK,OAAe,CAAC,gBAAgB,EAAE;gBACrC,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;aACtB;iBAAM,IAAI,OAAO,CAAC,gBAAgB,EAAE;gBACnC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACpB;iBAAM;gBACL,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACpB;YACD,MAAM,GAAG,IAAI,CAAC;SACf;QACD,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAEtD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AARD,gCAQC"}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isBuffer = void 0;
|
|
3
|
+
exports.isUint8Array = exports.isBuffer = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Tests to see if the object is Buffer
|
|
6
6
|
* @param target
|
|
7
7
|
* @returns {boolean}
|
|
8
8
|
*/
|
|
9
9
|
function isBuffer(target) {
|
|
10
|
-
|
|
10
|
+
// is Class
|
|
11
|
+
if (target && "isBuffer" in target && typeof target.isBuffer === "function") {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
return isUint8Array(target);
|
|
11
15
|
}
|
|
12
16
|
exports.isBuffer = isBuffer;
|
|
17
|
+
function isUint8Array(target) {
|
|
18
|
+
return !!(target && (target === Uint8Array || target instanceof Uint8Array));
|
|
19
|
+
}
|
|
20
|
+
exports.isUint8Array = isUint8Array;
|
|
13
21
|
//# sourceMappingURL=isBuffer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isBuffer.js","sourceRoot":"","sources":["../../../../src/utils/objects/isBuffer.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"isBuffer.js","sourceRoot":"","sources":["../../../../src/utils/objects/isBuffer.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,MAAW;IAClC,WAAW;IACX,IAAI,MAAM,IAAI,UAAU,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,UAAU,EAAE;QAC3E,OAAO,IAAI,CAAC;KACb;IAED,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAPD,4BAOC;AAED,SAAgB,YAAY,CAAC,MAAW;IACtC,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,KAAK,UAAU,IAAI,MAAM,YAAY,UAAU,CAAC,CAAC,CAAC;AAC/E,CAAC;AAFD,oCAEC"}
|
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
function deprecate(fn, msg) {
|
|
2
|
+
if (typeof process !== "undefined" && process.noDeprecation === true) {
|
|
3
|
+
return fn;
|
|
4
|
+
}
|
|
5
|
+
// Allow for deprecating things in the process of starting up.
|
|
6
|
+
if (typeof process === "undefined") {
|
|
7
|
+
return function (...args) {
|
|
8
|
+
return deprecate(fn, msg).apply(this, args);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
let warned = false;
|
|
12
|
+
function deprecated(...args) {
|
|
13
|
+
if (!warned) {
|
|
14
|
+
if (process.throwDeprecation) {
|
|
15
|
+
throw new Error(msg);
|
|
16
|
+
}
|
|
17
|
+
else if (process.traceDeprecation) {
|
|
18
|
+
console.trace(msg);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
console.error(msg);
|
|
22
|
+
}
|
|
23
|
+
warned = true;
|
|
24
|
+
}
|
|
25
|
+
return fn.apply(this, args);
|
|
26
|
+
}
|
|
27
|
+
return deprecated;
|
|
28
|
+
}
|
|
2
29
|
/**
|
|
3
30
|
* The `@Deprecated()` decorators wraps the given method in such a way that it is marked as deprecated.
|
|
4
31
|
*
|
|
@@ -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":"AAEA,SAAS,SAAS,CAAC,EAAO,EAAE,GAAW;IACrC,IAAI,OAAO,OAAO,KAAK,WAAW,IAAK,OAAe,CAAC,aAAa,KAAK,IAAI,EAAE;QAC7E,OAAO,EAAE,CAAC;KACX;IAED,8DAA8D;IAC9D,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QAClC,OAAO,UAAU,GAAG,IAAW;YAC7B,OAAO,SAAS,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC,CAAC;KACH;IAED,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,SAAS,UAAU,CAAC,GAAG,IAAW;QAChC,IAAI,CAAC,MAAM,EAAE;YACX,IAAK,OAAe,CAAC,gBAAgB,EAAE;gBACrC,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;aACtB;iBAAM,IAAI,OAAO,CAAC,gBAAgB,EAAE;gBACnC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACpB;iBAAM;gBACL,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACpB;YACD,MAAM,GAAG,IAAI,CAAC;SACf;QACD,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
|
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
* @returns {boolean}
|
|
5
5
|
*/
|
|
6
6
|
export function isBuffer(target) {
|
|
7
|
-
|
|
7
|
+
// is Class
|
|
8
|
+
if (target && "isBuffer" in target && typeof target.isBuffer === "function") {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
return isUint8Array(target);
|
|
12
|
+
}
|
|
13
|
+
export function isUint8Array(target) {
|
|
14
|
+
return !!(target && (target === Uint8Array || target instanceof Uint8Array));
|
|
8
15
|
}
|
|
9
16
|
//# sourceMappingURL=isBuffer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isBuffer.js","sourceRoot":"","sources":["../../../../src/utils/objects/isBuffer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isBuffer.js","sourceRoot":"","sources":["../../../../src/utils/objects/isBuffer.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAW;IAClC,WAAW;IACX,IAAI,MAAM,IAAI,UAAU,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,UAAU,EAAE;QAC3E,OAAO,IAAI,CAAC;KACb;IAED,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAW;IACtC,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,KAAK,UAAU,IAAI,MAAM,YAAY,UAAU,CAAC,CAAC,CAAC;AAC/E,CAAC"}
|