@tachybase/utils 1.3.26 → 1.3.28
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/lib/perf-hooks.js
CHANGED
|
@@ -22,7 +22,7 @@ __export(perf_hooks_exports, {
|
|
|
22
22
|
prePerfHooksWrap: () => prePerfHooksWrap
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(perf_hooks_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_node_perf_hooks = require("node:perf_hooks");
|
|
26
26
|
const prePerfHooksWrap = /* @__PURE__ */ __name((handler, options) => {
|
|
27
27
|
const { name } = options || {};
|
|
28
28
|
return async (ctx, next) => {
|
|
@@ -30,9 +30,9 @@ const prePerfHooksWrap = /* @__PURE__ */ __name((handler, options) => {
|
|
|
30
30
|
return await handler(ctx, next);
|
|
31
31
|
}
|
|
32
32
|
const histogram = ctx.getPerfHistogram(name || handler);
|
|
33
|
-
const start =
|
|
33
|
+
const start = import_node_perf_hooks.performance.now();
|
|
34
34
|
await handler(ctx, async () => {
|
|
35
|
-
const duration =
|
|
35
|
+
const duration = import_node_perf_hooks.performance.now() - start;
|
|
36
36
|
histogram.record(Math.ceil(duration * 1e6));
|
|
37
37
|
await next();
|
|
38
38
|
});
|
|
@@ -46,10 +46,10 @@ const postPerfHooksWrap = /* @__PURE__ */ __name((handler, options) => {
|
|
|
46
46
|
}
|
|
47
47
|
await next();
|
|
48
48
|
const histogram = ctx.getPerfHistogram(name || handler);
|
|
49
|
-
const start =
|
|
49
|
+
const start = import_node_perf_hooks.performance.now();
|
|
50
50
|
await handler(ctx, async () => {
|
|
51
51
|
});
|
|
52
|
-
const duration =
|
|
52
|
+
const duration = import_node_perf_hooks.performance.now() - start;
|
|
53
53
|
histogram.record(Math.ceil(duration * 1e6));
|
|
54
54
|
};
|
|
55
55
|
}, "postPerfHooksWrap");
|
|
@@ -31,7 +31,7 @@ export interface ServiceMetadata<Type = unknown> {
|
|
|
31
31
|
/**
|
|
32
32
|
* Instance of the target class.
|
|
33
33
|
*/
|
|
34
|
-
value: unknown |
|
|
34
|
+
value: unknown | symbol;
|
|
35
35
|
/**
|
|
36
36
|
* Allows to setup multiple instances the different classes under a single service id string or token.
|
|
37
37
|
*/
|
|
@@ -9,7 +9,7 @@ import { ServiceIdentifier } from '../types/service-identifier.type';
|
|
|
9
9
|
* @param propertyName the name of the property in case of a PropertyDecorator
|
|
10
10
|
* @param index the index of the parameter in the constructor in case of ParameterDecorator
|
|
11
11
|
*/
|
|
12
|
-
export declare function resolveToTypeWrapper(typeOrIdentifier: ((type?: never) => Constructable<unknown>) | ServiceIdentifier<unknown> | undefined, target:
|
|
12
|
+
export declare function resolveToTypeWrapper(typeOrIdentifier: ((type?: never) => Constructable<unknown>) | ServiceIdentifier<unknown> | undefined, target: object, propertyName: string | symbol, index?: number): {
|
|
13
13
|
eagerType: ServiceIdentifier | null;
|
|
14
14
|
lazyType: (type?: never) => ServiceIdentifier;
|
|
15
15
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/utils",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.28",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -43,8 +43,5 @@
|
|
|
43
43
|
"@types/multer": "1.4.13",
|
|
44
44
|
"@types/node": "20.17.10",
|
|
45
45
|
"i18next": "23.16.8"
|
|
46
|
-
},
|
|
47
|
-
"scripts": {
|
|
48
|
-
"build": "tachybase-build --no-dts @tachybase/utils"
|
|
49
46
|
}
|
|
50
47
|
}
|