@oh-my-pi/pi-utils 15.5.3 → 15.5.6
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/package.json +2 -2
- package/src/logger.ts +2 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-utils",
|
|
4
|
-
"version": "15.5.
|
|
4
|
+
"version": "15.5.6",
|
|
5
5
|
"description": "Shared utilities for pi packages",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"fmt": "biome format --write ."
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@oh-my-pi/pi-natives": "15.5.
|
|
34
|
+
"@oh-my-pi/pi-natives": "15.5.6",
|
|
35
35
|
"beautiful-mermaid": "^1.1.3",
|
|
36
36
|
"handlebars": "^4.7.9",
|
|
37
37
|
"winston": "^3.19.0",
|
package/src/logger.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
13
13
|
import * as fs from "node:fs";
|
|
14
|
+
import { isPromise } from "node:util/types";
|
|
14
15
|
import winston from "winston";
|
|
15
16
|
import DailyRotateFile from "winston-daily-rotate-file";
|
|
16
17
|
import { getLogsDir } from "./dirs";
|
|
@@ -402,7 +403,7 @@ export function time<T, A extends unknown[]>(op: string, fn?: (...args: A) => T,
|
|
|
402
403
|
};
|
|
403
404
|
try {
|
|
404
405
|
const result = spanStorage.run(span, () => fn(...args));
|
|
405
|
-
if (result
|
|
406
|
+
if (isPromise(result)) {
|
|
406
407
|
return result.finally(finish) as T;
|
|
407
408
|
}
|
|
408
409
|
finish();
|