@anjianshi/utils 1.2.3 → 1.2.5
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/env-node/logging.d.ts +5 -6
- package/env-node/logging.js +1 -1
- package/init-dayjs.js +3 -3
- package/package.json +2 -1
- package/src/env-node/logging.ts +1 -1
- package/src/init-dayjs.ts +3 -3
package/env-node/logging.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as chalk from 'chalk';
|
|
2
1
|
import { type Logger, type LogInfo, LogHandler } from '../logging/index.js';
|
|
3
2
|
export * from '../logging/index.js';
|
|
4
3
|
/**
|
|
@@ -25,14 +24,14 @@ export declare class ConsoleHandler extends LogHandler {
|
|
|
25
24
|
};
|
|
26
25
|
};
|
|
27
26
|
static readonly levelColors: {
|
|
28
|
-
1: chalk.
|
|
29
|
-
2: chalk.
|
|
30
|
-
3: chalk.
|
|
31
|
-
4: chalk.
|
|
27
|
+
1: import("chalk").ChalkInstance;
|
|
28
|
+
2: import("chalk").ChalkInstance;
|
|
29
|
+
3: import("chalk").ChalkInstance;
|
|
30
|
+
4: import("chalk").ChalkInstance;
|
|
32
31
|
};
|
|
33
32
|
private static readonly loggerColors;
|
|
34
33
|
private static readonly loggerColorMap;
|
|
35
|
-
static getLoggerColor(logger: string): "green" | "yellow" | "blue" | "
|
|
34
|
+
static getLoggerColor(logger: string): "green" | "yellow" | "blue" | "cyan" | "magenta" | "greenBright" | "yellowBright" | "blueBright" | "cyanBright" | "magentaBright";
|
|
36
35
|
}
|
|
37
36
|
/**
|
|
38
37
|
* 写入文件日志
|
package/env-node/logging.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import fs from 'node:fs';
|
|
6
6
|
import path from 'node:path';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
|
-
import
|
|
8
|
+
import chalk from 'chalk';
|
|
9
9
|
import dayjs from 'dayjs';
|
|
10
10
|
import { logger as defaultLogger, LogLevel, LogHandler, formatters, } from '../logging/index.js';
|
|
11
11
|
export * from '../logging/index.js';
|
package/init-dayjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as dayjs from 'dayjs';
|
|
2
2
|
import objectSupport from 'dayjs/plugin/objectSupport.js';
|
|
3
3
|
import 'dayjs/locale/zh-cn.js';
|
|
4
4
|
export function initDayJs() {
|
|
5
|
-
extend(objectSupport);
|
|
6
|
-
locale('zh-cn');
|
|
5
|
+
dayjs.extend(objectSupport);
|
|
6
|
+
dayjs.locale('zh-cn');
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anjianshi/utils",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "Common JavaScript Utils",
|
|
5
5
|
"homepage": "https://github.com/anjianshi/js-utils",
|
|
6
6
|
"bugs": {
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"@types/debug": "^4.1.9",
|
|
37
37
|
"@types/lodash": "^4.14.199",
|
|
38
38
|
"@types/node": "^20.8.6",
|
|
39
|
+
"chalk": "^5.3.0",
|
|
39
40
|
"vconsole": "^3.15.1"
|
|
40
41
|
},
|
|
41
42
|
"eslintIgnore": [],
|
package/src/env-node/logging.ts
CHANGED
package/src/init-dayjs.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as dayjs from 'dayjs'
|
|
2
2
|
import objectSupport from 'dayjs/plugin/objectSupport.js'
|
|
3
3
|
import 'dayjs/locale/zh-cn.js'
|
|
4
4
|
|
|
5
5
|
export function initDayJs() {
|
|
6
|
-
extend(objectSupport)
|
|
7
|
-
locale('zh-cn')
|
|
6
|
+
dayjs.extend(objectSupport)
|
|
7
|
+
dayjs.locale('zh-cn')
|
|
8
8
|
}
|