@wener/common 2.0.3 → 2.0.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.
Files changed (312) hide show
  1. package/lib/ai/qwen3vl/index.js +1 -1
  2. package/lib/ai/qwen3vl/utils.js +15 -15
  3. package/lib/ai/qwen3vl/utils.js.map +1 -1
  4. package/lib/ai/vision/DocLayoutElementTypeSchema.js +22 -22
  5. package/lib/ai/vision/ImageAnnotationSchema.js +63 -47
  6. package/lib/ai/vision/index.js +2 -2
  7. package/lib/ai/vision/resolveImageAnnotation.js +81 -95
  8. package/lib/cn/ChineseResidentIdNo.js +55 -41
  9. package/lib/cn/ChineseResidentIdNo.js.map +1 -1
  10. package/lib/cn/ChineseResidentIdNo.mod.js +6 -1
  11. package/lib/cn/ChineseResidentIdNo.test.js +22 -21
  12. package/lib/cn/DivisionCode.js +220 -235
  13. package/lib/cn/DivisionCode.mod.js +6 -1
  14. package/lib/cn/DivisionCode.test.js +92 -121
  15. package/lib/cn/Mod11.js +18 -37
  16. package/lib/cn/Mod11.js.map +1 -1
  17. package/lib/cn/Mod31.js +23 -41
  18. package/lib/cn/UnifiedSocialCreditCode.js +143 -137
  19. package/lib/cn/UnifiedSocialCreditCode.mod.js +6 -1
  20. package/lib/cn/UnifiedSocialCreditCode.test.js +21 -15
  21. package/lib/cn/formatChineseAmount.js +46 -71
  22. package/lib/cn/index.js +6 -6
  23. package/lib/cn/mod.js +5 -3
  24. package/lib/cn/parseChineseNumber.js +81 -85
  25. package/lib/cn/parseChineseNumber.test.js +183 -261
  26. package/lib/cn/pinyin/cartesianProduct.js +19 -19
  27. package/lib/cn/pinyin/cartesianProduct.test.js +78 -178
  28. package/lib/cn/pinyin/loader.js +13 -11
  29. package/lib/cn/pinyin/preload.js +2 -1
  30. package/lib/cn/pinyin/toPinyin.test.js +149 -161
  31. package/lib/cn/pinyin/toPinyinPure.js +28 -23
  32. package/lib/cn/pinyin/transform.js +11 -11
  33. package/lib/cn/types.d.js +2 -2
  34. package/lib/consola/createStandardConsolaReporter.js +14 -15
  35. package/lib/consola/formatLogObject.js +149 -133
  36. package/lib/consola/formatLogObject.js.map +1 -1
  37. package/lib/consola/formatLogObject.test.js +167 -178
  38. package/lib/consola/index.js +2 -2
  39. package/lib/data/formatSort.js +14 -12
  40. package/lib/data/formatSort.test.js +33 -33
  41. package/lib/data/index.js +3 -3
  42. package/lib/data/maybeNumber.js +23 -23
  43. package/lib/data/maybeNumber.js.map +1 -1
  44. package/lib/data/parseSort.js +75 -68
  45. package/lib/data/parseSort.test.js +196 -187
  46. package/lib/data/resolvePagination.js +38 -39
  47. package/lib/data/resolvePagination.test.js +228 -218
  48. package/lib/data/types.d.js +2 -2
  49. package/lib/data/types.d.js.map +1 -1
  50. package/lib/dayjs/dayjs.js +20 -20
  51. package/lib/dayjs/formatDuration.js +56 -56
  52. package/lib/dayjs/formatDuration.js.map +1 -1
  53. package/lib/dayjs/formatDuration.test.js +63 -77
  54. package/lib/dayjs/index.js +4 -4
  55. package/lib/dayjs/parseDuration.js +21 -26
  56. package/lib/dayjs/parseRelativeTime.js +65 -66
  57. package/lib/dayjs/parseRelativeTime.test.js +227 -243
  58. package/lib/dayjs/resolveRelativeTime.js +74 -144
  59. package/lib/dayjs/resolveRelativeTime.js.map +1 -1
  60. package/lib/dayjs/resolveRelativeTime.test.js +296 -307
  61. package/lib/decimal/index.js +1 -1
  62. package/lib/decimal/parseDecimal.js +12 -12
  63. package/lib/drain3/Drain.js +321 -0
  64. package/lib/drain3/Drain.js.map +1 -0
  65. package/lib/drain3/LogCluster.js +38 -0
  66. package/lib/drain3/LogCluster.js.map +1 -0
  67. package/lib/drain3/Node.js +39 -0
  68. package/lib/drain3/Node.js.map +1 -0
  69. package/lib/drain3/TemplateMiner.js +205 -0
  70. package/lib/drain3/TemplateMiner.js.map +1 -0
  71. package/lib/drain3/index.js +31 -0
  72. package/lib/drain3/index.js.map +1 -0
  73. package/lib/drain3/persistence/FilePersistence.js +24 -0
  74. package/lib/drain3/persistence/FilePersistence.js.map +1 -0
  75. package/lib/drain3/persistence/MemoryPersistence.js +18 -0
  76. package/lib/drain3/persistence/MemoryPersistence.js.map +1 -0
  77. package/lib/drain3/persistence/PersistenceHandler.js +5 -0
  78. package/lib/drain3/persistence/PersistenceHandler.js.map +1 -0
  79. package/lib/drain3/types.js +7 -0
  80. package/lib/drain3/types.js.map +1 -0
  81. package/lib/emittery/emitter.js +7 -7
  82. package/lib/emittery/index.js +1 -1
  83. package/lib/foundation/schema/SexType.js +15 -12
  84. package/lib/foundation/schema/index.js +1 -1
  85. package/lib/foundation/schema/parseSexType.js +15 -16
  86. package/lib/foundation/schema/types.js +8 -6
  87. package/lib/fs/FileSystemError.js +18 -18
  88. package/lib/fs/IFileSystem.d.js +2 -2
  89. package/lib/fs/IFileSystem.d.js.map +1 -1
  90. package/lib/fs/MemoryFileSystem.test.js +172 -181
  91. package/lib/fs/createBrowserFileSystem.js +222 -233
  92. package/lib/fs/createBrowserFileSystem.js.map +1 -1
  93. package/lib/fs/createMemoryFileSystem.js +473 -510
  94. package/lib/fs/createMemoryFileSystem.js.map +1 -1
  95. package/lib/fs/createSandboxFileSystem.js +102 -101
  96. package/lib/fs/createSandboxFileSystem.js.map +1 -1
  97. package/lib/fs/createWebDavFileSystem.js +162 -132
  98. package/lib/fs/createWebDavFileSystem.js.map +1 -1
  99. package/lib/fs/createWebFileSystem.js +202 -0
  100. package/lib/fs/createWebFileSystem.js.map +1 -0
  101. package/lib/fs/findMimeType.js +14 -14
  102. package/lib/fs/findMimeType.js.map +1 -1
  103. package/lib/fs/index.js +7 -7
  104. package/lib/fs/index.js.map +1 -1
  105. package/lib/fs/minio/createMinioFileSystem.js +977 -0
  106. package/lib/fs/minio/createMinioFileSystem.js.map +1 -0
  107. package/lib/fs/minio/index.js +2 -0
  108. package/lib/fs/minio/index.js.map +1 -0
  109. package/lib/fs/orpc/FileSystemContract.js +57 -57
  110. package/lib/fs/orpc/createContractClientFileSystem.js +88 -88
  111. package/lib/fs/orpc/createContractClientFileSystem.js.map +1 -1
  112. package/lib/fs/orpc/index.js +2 -2
  113. package/lib/fs/orpc/server/createFileSystemContractImpl.js +62 -60
  114. package/lib/fs/orpc/server/createFileSystemContractImpl.js.map +1 -1
  115. package/lib/fs/orpc/server/index.js +1 -1
  116. package/lib/fs/s3/createS3MiniFileSystem.js +756 -689
  117. package/lib/fs/s3/createS3MiniFileSystem.js.map +1 -1
  118. package/lib/fs/s3/index.js +1 -1
  119. package/lib/fs/s3/s3mini.test.js +524 -553
  120. package/lib/fs/scandir.js +56 -56
  121. package/lib/fs/server/createDatabaseFileSystem.js +834 -741
  122. package/lib/fs/server/createDatabaseFileSystem.js.map +1 -1
  123. package/lib/fs/server/createNodeFileSystem.js +407 -380
  124. package/lib/fs/server/createNodeFileSystem.js.map +1 -1
  125. package/lib/fs/server/dbfs.test.js +201 -214
  126. package/lib/fs/server/index.js +1 -1
  127. package/lib/fs/server/loadTestDatabase.js +40 -43
  128. package/lib/fs/tests/runFileSystemTest.js +352 -315
  129. package/lib/fs/tests/runFileSystemTest.js.map +1 -1
  130. package/lib/fs/types.js +17 -20
  131. package/lib/fs/utils/getFileUrl.js +24 -30
  132. package/lib/fs/utils.js +17 -17
  133. package/lib/fs/utils.js.map +1 -1
  134. package/lib/fs/webdav/index.js +2 -0
  135. package/lib/fs/webdav/index.js.map +1 -0
  136. package/lib/index.js +2 -2
  137. package/lib/jsonschema/JsonSchema.js +216 -155
  138. package/lib/jsonschema/JsonSchema.js.map +1 -1
  139. package/lib/jsonschema/JsonSchema.test.js +123 -124
  140. package/lib/jsonschema/forEachJsonSchema.js +41 -41
  141. package/lib/jsonschema/forEachJsonSchema.js.map +1 -1
  142. package/lib/jsonschema/index.js +2 -2
  143. package/lib/jsonschema/types.d.js +2 -2
  144. package/lib/jsonschema/types.d.js.map +1 -1
  145. package/lib/meta/defineFileType.js +32 -38
  146. package/lib/meta/defineInit.js +39 -35
  147. package/lib/meta/defineMetadata.js +37 -34
  148. package/lib/meta/defineMetadata.js.map +1 -1
  149. package/lib/meta/defineMetadata.test.js +13 -12
  150. package/lib/meta/index.js +3 -3
  151. package/lib/orpc/createOpenApiContractClient.js +26 -24
  152. package/lib/orpc/createOpenApiContractClient.js.map +1 -1
  153. package/lib/orpc/createRpcContractClient.js +37 -31
  154. package/lib/orpc/index.js +2 -2
  155. package/lib/orpc/resolveLinkPlugins.js +25 -25
  156. package/lib/password/PHC.js +187 -189
  157. package/lib/password/PHC.js.map +1 -1
  158. package/lib/password/PHC.test.js +517 -535
  159. package/lib/password/Password.js +85 -80
  160. package/lib/password/Password.test.js +330 -364
  161. package/lib/password/createArgon2PasswordAlgorithm.js +50 -51
  162. package/lib/password/createArgon2PasswordAlgorithm.js.map +1 -1
  163. package/lib/password/createBase64PasswordAlgorithm.js +11 -11
  164. package/lib/password/createBase64PasswordAlgorithm.js.map +1 -1
  165. package/lib/password/createBcryptPasswordAlgorithm.js +20 -18
  166. package/lib/password/createBcryptPasswordAlgorithm.js.map +1 -1
  167. package/lib/password/createPBKDF2PasswordAlgorithm.js +65 -52
  168. package/lib/password/createPBKDF2PasswordAlgorithm.js.map +1 -1
  169. package/lib/password/createScryptPasswordAlgorithm.js +74 -63
  170. package/lib/password/createScryptPasswordAlgorithm.js.map +1 -1
  171. package/lib/password/index.js +5 -5
  172. package/lib/password/server/index.js +1 -1
  173. package/lib/resource/Identifiable.js +2 -2
  174. package/lib/resource/ListQuery.js +42 -42
  175. package/lib/resource/ListQuery.js.map +1 -1
  176. package/lib/resource/getTitleOfResource.js +5 -5
  177. package/lib/resource/index.js +2 -2
  178. package/lib/resource/index.js.map +1 -1
  179. package/lib/resource/schema/AnyResourceSchema.js +91 -89
  180. package/lib/resource/schema/BaseResourceSchema.js +26 -26
  181. package/lib/resource/schema/ResourceActionType.js +117 -115
  182. package/lib/resource/schema/ResourceStatus.js +94 -92
  183. package/lib/resource/schema/ResourceType.js +25 -23
  184. package/lib/resource/schema/index.js +5 -5
  185. package/lib/resource/schema/types.js +86 -55
  186. package/lib/resource/schema/types.test.js +16 -13
  187. package/lib/s3/formatS3Url.js +60 -60
  188. package/lib/s3/formatS3Url.js.map +1 -1
  189. package/lib/s3/formatS3Url.test.js +238 -261
  190. package/lib/s3/index.js +2 -2
  191. package/lib/s3/parseS3Url.js +61 -60
  192. package/lib/s3/parseS3Url.js.map +1 -1
  193. package/lib/s3/parseS3Url.test.js +270 -269
  194. package/lib/schema/SchemaRegistry.js +41 -42
  195. package/lib/schema/SchemaRegistry.js.map +1 -1
  196. package/lib/schema/SchemaRegistry.mod.js +1 -1
  197. package/lib/schema/TypeSchema.d.js +2 -2
  198. package/lib/schema/TypeSchema.d.js.map +1 -1
  199. package/lib/schema/createSchemaData.js +113 -67
  200. package/lib/schema/createSchemaData.js.map +1 -1
  201. package/lib/schema/findJsonSchemaByPath.js +28 -23
  202. package/lib/schema/findJsonSchemaByPath.js.map +1 -1
  203. package/lib/schema/formatZodError.js +113 -134
  204. package/lib/schema/formatZodError.js.map +1 -1
  205. package/lib/schema/formatZodError.test.js +192 -195
  206. package/lib/schema/getSchemaCache.js +7 -7
  207. package/lib/schema/getSchemaOptions.js +17 -16
  208. package/lib/schema/index.js +6 -6
  209. package/lib/schema/toJsonSchema.js +196 -190
  210. package/lib/schema/toJsonSchema.js.map +1 -1
  211. package/lib/schema/toJsonSchema.test.js +34 -26
  212. package/lib/schema/validate.js +106 -97
  213. package/lib/schema/validate.js.map +1 -1
  214. package/lib/tools/generateSchema.js +40 -40
  215. package/lib/tools/renderJsonSchemaToMarkdownDoc.js +74 -74
  216. package/lib/utils/buildBaseUrl.js +8 -8
  217. package/lib/utils/buildRedactorFormSchema.js +55 -54
  218. package/lib/utils/buildRedactorFormSchema.js.map +1 -1
  219. package/lib/utils/getEstimateProcessTime.js +24 -19
  220. package/lib/utils/index.js +3 -3
  221. package/lib/utils/resolveFeatureOptions.js +9 -9
  222. package/package.json +37 -18
  223. package/src/ai/qwen3vl/utils.ts +1 -1
  224. package/src/ai/vision/index.ts +2 -2
  225. package/src/cn/ChineseResidentIdNo.ts +1 -1
  226. package/src/cn/Mod11.ts +1 -1
  227. package/src/cn/__snapshots__/ChineseResidentIdNo.test.ts.snap +1 -1
  228. package/src/cn/__snapshots__/UnifiedSocialCreditCode.test.ts.snap +0 -23
  229. package/src/cn/index.ts +1 -2
  230. package/src/cn/parseChineseNumber.test.ts +4 -4
  231. package/src/consola/formatLogObject.ts +6 -6
  232. package/src/consola/index.ts +1 -1
  233. package/src/data/index.ts +3 -4
  234. package/src/data/maybeNumber.ts +1 -1
  235. package/src/data/parseSort.test.ts +0 -1
  236. package/src/data/resolvePagination.ts +2 -2
  237. package/src/data/types.d.ts +2 -2
  238. package/src/dayjs/formatDuration.ts +10 -11
  239. package/src/dayjs/index.ts +1 -1
  240. package/src/dayjs/parseRelativeTime.ts +1 -1
  241. package/src/dayjs/resolveRelativeTime.ts +11 -14
  242. package/src/drain3/Drain.test.ts +378 -0
  243. package/src/drain3/Drain.ts +394 -0
  244. package/src/drain3/LogCluster.ts +46 -0
  245. package/src/drain3/Node.ts +53 -0
  246. package/src/drain3/TemplateMiner.ts +246 -0
  247. package/src/drain3/index.ts +34 -0
  248. package/src/drain3/persistence/FilePersistence.ts +24 -0
  249. package/src/drain3/persistence/MemoryPersistence.ts +23 -0
  250. package/src/drain3/persistence/PersistenceHandler.ts +19 -0
  251. package/src/drain3/types.ts +75 -0
  252. package/src/fs/IFileSystem.d.ts +1 -2
  253. package/src/fs/createBrowserFileSystem.ts +7 -5
  254. package/src/fs/createMemoryFileSystem.ts +9 -13
  255. package/src/fs/createSandboxFileSystem.ts +1 -1
  256. package/src/fs/createWebDavFileSystem.ts +30 -17
  257. package/src/fs/createWebFileSystem.ts +242 -0
  258. package/src/fs/findMimeType.ts +1 -4
  259. package/src/fs/index.ts +5 -5
  260. package/src/fs/minio/createMinioFileSystem.ts +1148 -0
  261. package/src/fs/minio/index.ts +1 -0
  262. package/src/fs/orpc/createContractClientFileSystem.ts +5 -5
  263. package/src/fs/orpc/server/createFileSystemContractImpl.ts +1 -1
  264. package/src/fs/s3/createS3MiniFileSystem.ts +120 -79
  265. package/src/fs/s3/s3fs.test.ts +441 -0
  266. package/src/fs/s3/s3mini.test.ts +2 -2
  267. package/src/fs/server/createDatabaseFileSystem.ts +78 -114
  268. package/src/fs/server/createNodeFileSystem.ts +32 -13
  269. package/src/fs/server/dbfs.test.ts +13 -8
  270. package/src/fs/server/index.ts +1 -0
  271. package/src/fs/server/loadTestDatabase.ts +8 -119
  272. package/src/fs/tests/runFileSystemTest.ts +29 -28
  273. package/src/fs/utils.ts +1 -1
  274. package/src/fs/webdav/index.ts +1 -0
  275. package/src/jsonschema/JsonSchema.ts +5 -5
  276. package/src/jsonschema/forEachJsonSchema.ts +1 -1
  277. package/src/jsonschema/index.ts +1 -1
  278. package/src/jsonschema/types.d.ts +1 -1
  279. package/src/meta/defineMetadata.ts +1 -1
  280. package/src/meta/index.ts +2 -3
  281. package/src/orm/createSqliteDialect.ts +17 -0
  282. package/src/orm/index.ts +1 -0
  283. package/src/orpc/createOpenApiContractClient.ts +3 -3
  284. package/src/orpc/index.ts +1 -1
  285. package/src/password/PHC.ts +3 -3
  286. package/src/password/createArgon2PasswordAlgorithm.ts +2 -2
  287. package/src/password/createBase64PasswordAlgorithm.ts +2 -2
  288. package/src/password/createBcryptPasswordAlgorithm.ts +4 -2
  289. package/src/password/createPBKDF2PasswordAlgorithm.ts +2 -2
  290. package/src/password/createScryptPasswordAlgorithm.ts +4 -4
  291. package/src/password/index.ts +2 -2
  292. package/src/resource/ListQuery.ts +4 -1
  293. package/src/resource/index.ts +3 -3
  294. package/src/resource/schema/index.ts +4 -4
  295. package/src/s3/formatS3Url.test.ts +1 -1
  296. package/src/s3/formatS3Url.ts +2 -2
  297. package/src/s3/index.ts +1 -1
  298. package/src/s3/parseS3Url.ts +1 -1
  299. package/src/schema/SchemaRegistry.ts +2 -2
  300. package/src/schema/TypeSchema.d.ts +6 -6
  301. package/src/schema/createSchemaData.ts +5 -5
  302. package/src/schema/findJsonSchemaByPath.ts +5 -5
  303. package/src/schema/formatZodError.test.ts +2 -1
  304. package/src/schema/formatZodError.ts +50 -62
  305. package/src/schema/index.ts +5 -5
  306. package/src/schema/toJsonSchema.ts +6 -6
  307. package/src/schema/validate.ts +2 -2
  308. package/src/utils/buildRedactorFormSchema.ts +4 -4
  309. package/src/utils/formatNumber.ts +18 -0
  310. package/src/utils/formatPercent.ts +17 -0
  311. package/src/utils/index.ts +3 -3
  312. package/src/utils/resolveFeatureOptions.ts +1 -1
@@ -1,14 +1,14 @@
1
1
  export function transformData(input) {
2
- let out = {};
3
- for (let [py, chars] of Object.entries(input)){
4
- for (let c of chars){
5
- if (!out[c]) {
6
- out[c] = [];
7
- }
8
- out[c].push(py);
9
- }
10
- }
11
- return out;
2
+ let out = {};
3
+ for (let [py, chars] of Object.entries(input)) {
4
+ for (let c of chars) {
5
+ if (!out[c]) {
6
+ out[c] = [];
7
+ }
8
+ out[c].push(py);
9
+ }
10
+ }
11
+ return out;
12
12
  }
13
13
 
14
- //# sourceMappingURL=transform.js.map
14
+ //# sourceMappingURL=transform.js.map
package/lib/cn/types.d.js CHANGED
@@ -3,6 +3,6 @@
3
3
  *
4
4
  * @see https://en.wikipedia.org/wiki/Resident_Identity_Card
5
5
  * @see https://en.wikipedia.org/wiki/Foreign_Permanent_Resident_ID_Card
6
- */ export { };
6
+ */ export {};
7
7
 
8
- //# sourceMappingURL=types.d.js.map
8
+ //# sourceMappingURL=types.d.js.map
@@ -1,18 +1,17 @@
1
- import { formatLogObject } from "./formatLogObject.js";
1
+ import { formatLogObject } from './formatLogObject.js';
2
2
  export function createStandardConsolaReporter({ format = formatLogObject } = {}) {
3
- return {
4
- log: (o, ctx) => {
5
- let out = format(o, ctx);
6
- let fn = console.log;
7
- const { level } = o;
8
- if (level < 1) {
9
- fn = console.error;
10
- }
11
- else if (level === 1) {
12
- fn = console.warn;
13
- }
14
- fn(out);
15
- }
16
- };
3
+ return {
4
+ log: (o, ctx) => {
5
+ let out = format(o, ctx);
6
+ let fn = console.log;
7
+ const { level } = o;
8
+ if (level < 1) {
9
+ fn = console.error;
10
+ } else if (level === 1) {
11
+ fn = console.warn;
12
+ }
13
+ fn(out);
14
+ },
15
+ };
17
16
  }
18
17
  //# sourceMappingURL=createStandardConsolaReporter.js.map
@@ -1,158 +1,174 @@
1
- import colors, { Chalk } from "chalk";
2
- import dayjs from "dayjs";
3
- import { isDevelopment } from "std-env";
1
+ import colors, { Chalk } from 'chalk';
2
+ import dayjs from 'dayjs';
3
+ import { isDevelopment } from 'std-env';
4
+
4
5
  const LevelColors = {
5
- trace: colors.gray,
6
- debug: colors.cyan,
7
- info: colors.blueBright,
8
- warn: colors.yellow,
9
- error: colors.red,
10
- fatal: colors.bgRed.white,
11
- silent: colors.white,
12
- log: colors.white,
13
- success: colors.green,
14
- fail: colors.red,
15
- ready: colors.green,
16
- start: colors.cyan,
17
- box: colors.white,
18
- verbose: colors.green
6
+ trace: colors.gray,
7
+ debug: colors.cyan,
8
+ info: colors.blueBright,
9
+ warn: colors.yellow,
10
+ error: colors.red,
11
+ fatal: colors.bgRed.white,
12
+ silent: colors.white,
13
+ log: colors.white,
14
+ success: colors.green,
15
+ fail: colors.red,
16
+ ready: colors.green,
17
+ start: colors.cyan,
18
+ box: colors.white,
19
+ verbose: colors.green,
19
20
  };
20
21
  const levelShort = {
21
- trace: 'TRAC',
22
- debug: 'DEBG',
23
- info: 'INFO',
24
- warn: 'WARN',
25
- error: 'ERRO',
26
- fatal: 'FATL',
27
- silent: 'SLNT',
28
- log: 'LOG ',
29
- success: 'SUCC',
30
- fail: 'FAIL',
31
- ready: 'READ',
32
- start: 'STRT',
33
- box: 'BOX ',
34
- verbose: 'VERB'
22
+ trace: 'TRAC',
23
+ debug: 'DEBG',
24
+ info: 'INFO',
25
+ warn: 'WARN',
26
+ error: 'ERRO',
27
+ fatal: 'FATL',
28
+ silent: 'SLNT',
29
+ log: 'LOG ',
30
+ success: 'SUCC',
31
+ fail: 'FAIL',
32
+ ready: 'READ',
33
+ start: 'STRT',
34
+ box: 'BOX ',
35
+ verbose: 'VERB',
35
36
  };
36
37
  const start = Date.now();
37
38
  const Colors = colors;
38
39
  const NoColors = new Chalk({
39
- level: 0
40
+ level: 0,
40
41
  });
41
42
  export function formatLogObject(o, ctx) {
42
- const shouldColor = Boolean(ctx.options?.formatOptions?.colors);
43
- let { date, type, tag } = o;
44
- type = type === 'log' ? 'info' : type;
45
- const colors = shouldColor ? Colors : NoColors;
46
- let color = LevelColors[type] || colors.white;
47
- if (!shouldColor) {
48
- color = (v)=>v;
49
- }
50
- const levelText = levelShort[type] || type.toUpperCase().slice(0, 4); // Get first 4 chars, consistent uppercase
51
- let line = '';
52
- let out = [];
53
- // Timestamp
54
- if (isDevelopment) {
55
- // process.hrtime.bigint()
56
- let diff = (date.getTime() - start) / 1000;
57
- out.push(colors.gray(diff.toFixed(3).padStart(7, ' ')));
58
- } else {
59
- out.push(colors.gray(dayjs(date).format('YYYY-MM-DD HH:mm:ss.SSS')));
60
- }
61
- // Log Level (colored)
62
- // Pad to 4 characters
63
- out.push(color(levelText.padEnd(4, ' ')));
64
- if (tag) {
65
- out.push(colors.yellow(`[${tag}]`)); // Added color for tag
66
- }
67
- {
68
- const [message, ...additional] = formatArgs(o.args, {
69
- colors: shouldColor
70
- }).split('\n');
71
- out.push(characterFormat(message));
72
- line = out.join(' ');
73
- if (additional.length > 0) {
74
- line += characterFormat(additional.join('\n'));
75
- }
76
- if (type === 'trace') {
77
- const _err = new Error('Trace: ' + o.message);
78
- line += formatStack(_err.stack || '', _err.message);
79
- }
80
- }
81
- // if (!message && typeof args[0] === 'string') {
82
- // message = args.shift();
83
- // }
84
- // if (message) {
85
- // out.push(message);
86
- // }
87
- // if (args.length) {
88
- // out.push(...args.map((a) => (typeof a === 'string' ? a : JSON.stringify(a)))); // Handle non-string args
89
- // }
90
- // todo format error
91
- // https://github.com/unjs/consola/blob/main/src/reporters/fancy.ts
92
- // return out.join(' '); // Increased spacing for better readability
93
- return line;
43
+ const shouldColor = Boolean(ctx.options?.formatOptions?.colors);
44
+ let { date, type, tag } = o;
45
+ type = type === 'log' ? 'info' : type;
46
+ const colors = shouldColor ? Colors : NoColors;
47
+ let color = LevelColors[type] || colors.white;
48
+ if (!shouldColor) {
49
+ color = (v) => v;
50
+ }
51
+ const levelText = levelShort[type] || type.toUpperCase().slice(0, 4); // Get first 4 chars, consistent uppercase
52
+ let line = '';
53
+ let out = [];
54
+ // Timestamp
55
+ if (isDevelopment) {
56
+ // process.hrtime.bigint()
57
+ let diff = (date.getTime() - start) / 1000;
58
+ out.push(colors.gray(diff.toFixed(3).padStart(7, ' ')));
59
+ } else {
60
+ out.push(colors.gray(dayjs(date).format('YYYY-MM-DD HH:mm:ss.SSS')));
61
+ }
62
+ // Log Level (colored)
63
+ // Pad to 4 characters
64
+ out.push(color(levelText.padEnd(4, ' ')));
65
+ if (tag) {
66
+ out.push(colors.yellow(`[${tag}]`)); // Added color for tag
67
+ }
68
+ {
69
+ const [message, ...additional] = formatArgs(o.args, {
70
+ colors: shouldColor,
71
+ }).split('\n');
72
+ out.push(characterFormat(message));
73
+ line = out.join(' ');
74
+ if (additional.length > 0) {
75
+ line += characterFormat(additional.join('\n'));
76
+ }
77
+ if (type === 'trace') {
78
+ const _err = new Error(`Trace: ${o.message}`);
79
+ line += formatStack(_err.stack || '', _err.message);
80
+ }
81
+ }
82
+ // if (!message && typeof args[0] === 'string') {
83
+ // message = args.shift();
84
+ // }
85
+ // if (message) {
86
+ // out.push(message);
87
+ // }
88
+ // if (args.length) {
89
+ // out.push(...args.map((a) => (typeof a === 'string' ? a : JSON.stringify(a)))); // Handle non-string args
90
+ // }
91
+ // todo format error
92
+ // https://github.com/unjs/consola/blob/main/src/reporters/fancy.ts
93
+ // return out.join(' '); // Increased spacing for better readability
94
+ return line;
94
95
  }
95
96
  function characterFormat(str) {
96
- return str// highlight backticks
97
- .replace(/`([^`]+)`/gm, (_, m)=>colors.cyan(m))// underline underscores
98
- .replace(/\s+_([^_]+)_\s+/gm, (_, m)=>` ${colors.underline(m)} `);
97
+ return str // highlight backticks
98
+ .replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m)) // underline underscores
99
+ .replace(/\s+_([^_]+)_\s+/gm, (_, m) => ` ${colors.underline(m)} `);
99
100
  }
100
101
  function parseStack(stack, message) {
101
- // const cwd = process.cwd() + sep;
102
- const lines = stack.split('\n').splice(message.split('\n').length).map((l)=>l.trim().replace('file://', ''));
103
- return lines;
102
+ // const cwd = process.cwd() + sep;
103
+ const lines = stack
104
+ .split('\n')
105
+ .splice(message.split('\n').length)
106
+ .map((l) => l.trim().replace('file://', ''));
107
+ return lines;
104
108
  }
105
109
  function formatStack(stack, message, opts) {
106
- const indent = ' '.repeat((opts?.errorLevel || 0) + 1);
107
- return `\n${indent}` + parseStack(stack, message).map((line)=>' ' + line.replace(/^at +/, (m)=>colors.gray(m)).replace(/\((.+)\)/, (_, m)=>`(${colors.cyan(m)})`)).join(`\n${indent}`);
110
+ const indent = ' '.repeat((opts?.errorLevel || 0) + 1);
111
+ return (
112
+ `\n${indent}` +
113
+ parseStack(stack, message)
114
+ .map(
115
+ (line) =>
116
+ ` ${line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_, m) => `(${colors.cyan(m)})`)}`,
117
+ )
118
+ .join(`\n${indent}`)
119
+ );
108
120
  }
109
121
  function formatArgs(args, opts) {
110
- const _args = args.map((arg)=>{
111
- if (arg && typeof arg.stack === 'string') {
112
- return formatError(arg, opts);
113
- }
114
- return arg;
115
- });
116
- // Only supported with Node >= 10
117
- // https://nodejs.org/api/util.html#util_util_inspect_object_options
118
- return formatWithOptions(Boolean(opts.colors), ..._args);
122
+ const _args = args.map((arg) => {
123
+ if (arg && typeof arg.stack === 'string') {
124
+ return formatError(arg, opts);
125
+ }
126
+ return arg;
127
+ });
128
+ // Only supported with Node >= 10
129
+ // https://nodejs.org/api/util.html#util_util_inspect_object_options
130
+ return formatWithOptions(Boolean(opts.colors), ..._args);
119
131
  }
120
132
  function formatWithOptions(shouldColor, ...params) {
121
- return params.map((value)=>formatValue(value, shouldColor)).join(' ');
133
+ return params.map((value) => formatValue(value, shouldColor)).join(' ');
122
134
  }
123
135
  function formatValue(value, shouldColor = false) {
124
- const colors = shouldColor ? Colors : NoColors;
125
- if (value === null) return 'null';
126
- if (value === undefined) return 'undefined';
127
- if (typeof value === 'string') return value;
128
- if (typeof value === 'number' || typeof value === 'boolean') return String(value);
129
- if (typeof value === 'object' && value.constructor === Object) {
130
- const entries = Object.entries(value);
131
- if (entries.length === 0) return '{}';
132
- return entries.map(([key, val])=>{
133
- const keyStr = shouldColor ? colors.blue(key) : key;
134
- const valStr = shouldColor ? colors.green(JSON.stringify(val)) : JSON.stringify(val);
135
- return `${keyStr}=${valStr}`;
136
- }).join(' ');
137
- }
138
- // For arrays and other objects, use JSON.stringify directly
139
- try {
140
- const result = JSON.stringify(value);
141
- return shouldColor ? colors.green(result) : result;
142
- } catch {
143
- return String(value);
144
- }
136
+ const colors = shouldColor ? Colors : NoColors;
137
+ if (value === null) return 'null';
138
+ if (value === undefined) return 'undefined';
139
+ if (typeof value === 'string') return value;
140
+ if (typeof value === 'number' || typeof value === 'boolean') return String(value);
141
+ if (typeof value === 'object' && value.constructor === Object) {
142
+ const entries = Object.entries(value);
143
+ if (entries.length === 0) return '{}';
144
+ return entries
145
+ .map(([key, val]) => {
146
+ const keyStr = shouldColor ? colors.blue(key) : key;
147
+ const valStr = shouldColor ? colors.green(JSON.stringify(val)) : JSON.stringify(val);
148
+ return `${keyStr}=${valStr}`;
149
+ })
150
+ .join(' ');
151
+ }
152
+ // For arrays and other objects, use JSON.stringify directly
153
+ try {
154
+ const result = JSON.stringify(value);
155
+ return shouldColor ? colors.green(result) : result;
156
+ } catch {
157
+ return String(value);
158
+ }
145
159
  }
146
160
  function formatError(err, opts) {
147
- const message = err.message ?? formatWithOptions(Boolean(opts.colors), err);
148
- const stack = err.stack ? formatStack(err.stack, message, opts) : '';
149
- const level = opts?.errorLevel || 0;
150
- const causedPrefix = level > 0 ? `${' '.repeat(level)}[cause]: ` : '';
151
- const causedError = err.cause ? '\n\n' + formatError(err.cause, {
152
- ...opts,
153
- errorLevel: level + 1
154
- }) : '';
155
- return causedPrefix + message + '\n' + stack + causedError;
161
+ const message = err.message ?? formatWithOptions(Boolean(opts.colors), err);
162
+ const stack = err.stack ? formatStack(err.stack, message, opts) : '';
163
+ const level = opts?.errorLevel || 0;
164
+ const causedPrefix = level > 0 ? `${' '.repeat(level)}[cause]: ` : '';
165
+ const causedError = err.cause
166
+ ? `\n\n${formatError(err.cause, {
167
+ ...opts,
168
+ errorLevel: level + 1,
169
+ })}`
170
+ : '';
171
+ return `${causedPrefix + message}\n${stack}${causedError}`;
156
172
  }
157
173
 
158
- //# sourceMappingURL=formatLogObject.js.map
174
+ //# sourceMappingURL=formatLogObject.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/consola/formatLogObject.ts"],"sourcesContent":["import colors, { Chalk, type ChalkInstance } from 'chalk';\nimport type { ConsolaOptions, FormatOptions, LogObject, LogType } from 'consola/core';\nimport dayjs from 'dayjs';\nimport { isDevelopment } from 'std-env';\n\nconst LevelColors: Record<LogType, (str: string) => string> = {\n\ttrace: colors.gray,\n\tdebug: colors.cyan,\n\tinfo: colors.blueBright,\n\twarn: colors.yellow,\n\terror: colors.red,\n\tfatal: colors.bgRed.white,\n\tsilent: colors.white,\n\tlog: colors.white,\n\tsuccess: colors.green,\n\tfail: colors.red,\n\tready: colors.green,\n\tstart: colors.cyan,\n\tbox: colors.white,\n\tverbose: colors.green,\n};\n\nconst levelShort: Record<LogType, string> = {\n\ttrace: 'TRAC',\n\tdebug: 'DEBG',\n\tinfo: 'INFO',\n\twarn: 'WARN',\n\terror: 'ERRO',\n\tfatal: 'FATL',\n\tsilent: 'SLNT',\n\tlog: 'LOG ', // Added space to make it 4 characters\n\tsuccess: 'SUCC',\n\tfail: 'FAIL',\n\tready: 'READ',\n\tstart: 'STRT',\n\tbox: 'BOX ', // Added space to make it 4 characters\n\tverbose: 'VERB',\n};\nconst start = Date.now();\n\nconst Colors: ChalkInstance = colors;\nconst NoColors = new Chalk({ level: 0 });\n\nexport function formatLogObject(\n\to: LogObject,\n\tctx: {\n\t\toptions: ConsolaOptions;\n\t},\n) {\n\tconst shouldColor = Boolean(ctx.options?.formatOptions?.colors);\n\n\tlet { date, type, tag } = o;\n\ttype = type === 'log' ? 'info' : type;\n\tconst colors = shouldColor ? Colors : NoColors;\n\tlet color = LevelColors[type] || colors.white;\n\tif (!shouldColor) {\n\t\tcolor = (v) => v;\n\t}\n\tconst levelText = levelShort[type] || type.toUpperCase().slice(0, 4); // Get first 4 chars, consistent uppercase\n\n\tlet line = '';\n\tlet out: string[] = [];\n\n\t// Timestamp\n\tif (isDevelopment) {\n\t\t// process.hrtime.bigint()\n\t\tlet diff = (date.getTime() - start) / 1000;\n\n\t\tout.push(colors.gray(diff.toFixed(3).padStart(7, ' ')));\n\t} else {\n\t\tout.push(colors.gray(dayjs(date).format('YYYY-MM-DD HH:mm:ss.SSS')));\n\t}\n\n\t// Log Level (colored)\n\t// Pad to 4 characters\n\tout.push(color(levelText.padEnd(4, ' ')));\n\n\tif (tag) {\n\t\tout.push(colors.yellow(`[${tag}]`)); // Added color for tag\n\t}\n\n\t{\n\t\tconst [message, ...additional] = formatArgs(o.args, { colors: shouldColor }).split('\\n');\n\n\t\tout.push(characterFormat(message));\n\n\t\tline = out.join(' ');\n\t\tif (additional.length > 0) {\n\t\t\tline += characterFormat(additional.join('\\n'));\n\t\t}\n\n\t\tif (type === 'trace') {\n\t\t\tconst _err = new Error('Trace: ' + o.message);\n\t\t\tline += formatStack(_err.stack || '', _err.message);\n\t\t}\n\t}\n\n\t// if (!message && typeof args[0] === 'string') {\n\t// message = args.shift();\n\t// }\n\t// if (message) {\n\t// out.push(message);\n\t// }\n\t// if (args.length) {\n\t// out.push(...args.map((a) => (typeof a === 'string' ? a : JSON.stringify(a)))); // Handle non-string args\n\t// }\n\n\t// todo format error\n\t// https://github.com/unjs/consola/blob/main/src/reporters/fancy.ts\n\n\t// return out.join(' '); // Increased spacing for better readability\n\treturn line;\n}\n\nfunction characterFormat(str: string) {\n\treturn (\n\t\tstr\n\t\t\t// highlight backticks\n\t\t\t.replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m))\n\t\t\t// underline underscores\n\t\t\t.replace(/\\s+_([^_]+)_\\s+/gm, (_, m) => ` ${colors.underline(m)} `)\n\t);\n}\n\nfunction parseStack(stack: string, message: string) {\n\t// const cwd = process.cwd() + sep;\n\n\tconst lines = stack\n\t\t.split('\\n')\n\t\t.splice(message.split('\\n').length)\n\t\t.map(\n\t\t\t(l) => l.trim().replace('file://', ''),\n\t\t\t// .replace(cwd, '')\n\t\t);\n\n\treturn lines;\n}\n\nfunction formatStack(stack: string, message: string, opts?: FormatOptions) {\n\tconst indent = ' '.repeat((opts?.errorLevel || 0) + 1);\n\treturn (\n\t\t`\\n${indent}`\n\t\t+ parseStack(stack, message)\n\t\t\t.map(\n\t\t\t\t(line) =>\n\t\t\t\t\t' ' + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\\((.+)\\)/, (_, m) => `(${colors.cyan(m)})`),\n\t\t\t)\n\t\t\t.join(`\\n${indent}`)\n\t);\n}\n\nfunction formatArgs(args: any[], opts: FormatOptions) {\n\tconst _args = args.map((arg) => {\n\t\tif (arg && typeof arg.stack === 'string') {\n\t\t\treturn formatError(arg, opts);\n\t\t}\n\t\treturn arg;\n\t});\n\n\t// Only supported with Node >= 10\n\t// https://nodejs.org/api/util.html#util_util_inspect_object_options\n\treturn formatWithOptions(Boolean(opts.colors), ..._args);\n}\n\nfunction formatWithOptions(shouldColor: boolean, ...params: any[]) {\n\treturn params.map((value) => formatValue(value, shouldColor)).join(' ');\n}\n\nfunction formatValue(value: any, shouldColor: boolean = false): string {\n\tconst colors = shouldColor ? Colors : NoColors;\n\n\tif (value === null) return 'null';\n\tif (value === undefined) return 'undefined';\n\tif (typeof value === 'string') return value;\n\tif (typeof value === 'number' || typeof value === 'boolean') return String(value);\n\n\tif (typeof value === 'object' && value.constructor === Object) {\n\t\tconst entries = Object.entries(value);\n\t\tif (entries.length === 0) return '{}';\n\t\treturn entries\n\t\t\t.map(([key, val]) => {\n\t\t\t\tconst keyStr = shouldColor ? colors.blue(key) : key;\n\t\t\t\tconst valStr = shouldColor ? colors.green(JSON.stringify(val)) : JSON.stringify(val);\n\t\t\t\treturn `${keyStr}=${valStr}`;\n\t\t\t})\n\t\t\t.join(' ');\n\t}\n\n\t// For arrays and other objects, use JSON.stringify directly\n\ttry {\n\t\tconst result = JSON.stringify(value);\n\t\treturn shouldColor ? colors.green(result) : result;\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n\nfunction formatError(err: any, opts: FormatOptions): string {\n\tconst message = err.message ?? formatWithOptions(Boolean(opts.colors), err);\n\tconst stack = err.stack ? formatStack(err.stack, message, opts) : '';\n\n\tconst level = opts?.errorLevel || 0;\n\tconst causedPrefix = level > 0 ? `${' '.repeat(level)}[cause]: ` : '';\n\tconst causedError = err.cause ? '\\n\\n' + formatError(err.cause, { ...opts, errorLevel: level + 1 }) : '';\n\n\treturn causedPrefix + message + '\\n' + stack + causedError;\n}\n"],"names":["colors","Chalk","dayjs","isDevelopment","LevelColors","trace","gray","debug","cyan","info","blueBright","warn","yellow","error","red","fatal","bgRed","white","silent","log","success","green","fail","ready","start","box","verbose","levelShort","Date","now","Colors","NoColors","level","formatLogObject","o","ctx","shouldColor","Boolean","options","formatOptions","date","type","tag","color","v","levelText","toUpperCase","slice","line","out","diff","getTime","push","toFixed","padStart","format","padEnd","message","additional","formatArgs","args","split","characterFormat","join","length","_err","Error","formatStack","stack","str","replace","_","m","underline","parseStack","lines","splice","map","l","trim","opts","indent","repeat","errorLevel","_args","arg","formatError","formatWithOptions","params","value","formatValue","undefined","String","Object","entries","key","val","keyStr","blue","valStr","JSON","stringify","result","err","causedPrefix","causedError","cause"],"mappings":"AAAA,OAAOA,UAAUC,KAAK,QAA4B,QAAQ;AAE1D,OAAOC,WAAW,QAAQ;AAC1B,SAASC,aAAa,QAAQ,UAAU;AAExC,MAAMC,cAAwD;IAC7DC,OAAOL,OAAOM,IAAI;IAClBC,OAAOP,OAAOQ,IAAI;IAClBC,MAAMT,OAAOU,UAAU;IACvBC,MAAMX,OAAOY,MAAM;IACnBC,OAAOb,OAAOc,GAAG;IACjBC,OAAOf,OAAOgB,KAAK,CAACC,KAAK;IACzBC,QAAQlB,OAAOiB,KAAK;IACpBE,KAAKnB,OAAOiB,KAAK;IACjBG,SAASpB,OAAOqB,KAAK;IACrBC,MAAMtB,OAAOc,GAAG;IAChBS,OAAOvB,OAAOqB,KAAK;IACnBG,OAAOxB,OAAOQ,IAAI;IAClBiB,KAAKzB,OAAOiB,KAAK;IACjBS,SAAS1B,OAAOqB,KAAK;AACtB;AAEA,MAAMM,aAAsC;IAC3CtB,OAAO;IACPE,OAAO;IACPE,MAAM;IACNE,MAAM;IACNE,OAAO;IACPE,OAAO;IACPG,QAAQ;IACRC,KAAK;IACLC,SAAS;IACTE,MAAM;IACNC,OAAO;IACPC,OAAO;IACPC,KAAK;IACLC,SAAS;AACV;AACA,MAAMF,QAAQI,KAAKC,GAAG;AAEtB,MAAMC,SAAwB9B;AAC9B,MAAM+B,WAAW,IAAI9B,MAAM;IAAE+B,OAAO;AAAE;AAEtC,OAAO,SAASC,gBACfC,CAAY,EACZC,GAEC;IAED,MAAMC,cAAcC,QAAQF,IAAIG,OAAO,EAAEC,eAAevC;IAExD,IAAI,EAAEwC,IAAI,EAAEC,IAAI,EAAEC,GAAG,EAAE,GAAGR;IAC1BO,OAAOA,SAAS,QAAQ,SAASA;IACjC,MAAMzC,SAASoC,cAAcN,SAASC;IACtC,IAAIY,QAAQvC,WAAW,CAACqC,KAAK,IAAIzC,OAAOiB,KAAK;IAC7C,IAAI,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ACvE,MAAMnC,QAAQmC,IAAInC,KAAK,GAAGD,YAAYoC,IAAInC,KAAK,EAAEX,SAASuB,QAAQ;IAElE,MAAMhD,QAAQgD,MAAMG,cAAc;IAClC,MAAMqB,eAAexE,QAAQ,IAAI,GAAG,KAAKkD,MAAM,CAAClD,OAAO,SAAS,CAAC,GAAG;IACpE,MAAMyE,cAAcF,IAAIG,KAAK,GAAG,SAASpB,YAAYiB,IAAIG,KAAK,EAAE;QAAE,GAAG1B,IAAI;QAAEG,YAAYnD,QAAQ;IAAE,KAAK;IAEtG,OAAOwE,eAAe/C,UAAU,OAAOW,QAAQqC;AAChD"}
1
+ {"version":3,"sources":["../../src/consola/formatLogObject.ts"],"sourcesContent":["import colors, { Chalk, type ChalkInstance } from 'chalk';\nimport type { ConsolaOptions, FormatOptions, LogObject, LogType } from 'consola/core';\nimport dayjs from 'dayjs';\nimport { isDevelopment } from 'std-env';\n\nconst LevelColors: Record<LogType, (str: string) => string> = {\n\ttrace: colors.gray,\n\tdebug: colors.cyan,\n\tinfo: colors.blueBright,\n\twarn: colors.yellow,\n\terror: colors.red,\n\tfatal: colors.bgRed.white,\n\tsilent: colors.white,\n\tlog: colors.white,\n\tsuccess: colors.green,\n\tfail: colors.red,\n\tready: colors.green,\n\tstart: colors.cyan,\n\tbox: colors.white,\n\tverbose: colors.green,\n};\n\nconst levelShort: Record<LogType, string> = {\n\ttrace: 'TRAC',\n\tdebug: 'DEBG',\n\tinfo: 'INFO',\n\twarn: 'WARN',\n\terror: 'ERRO',\n\tfatal: 'FATL',\n\tsilent: 'SLNT',\n\tlog: 'LOG ', // Added space to make it 4 characters\n\tsuccess: 'SUCC',\n\tfail: 'FAIL',\n\tready: 'READ',\n\tstart: 'STRT',\n\tbox: 'BOX ', // Added space to make it 4 characters\n\tverbose: 'VERB',\n};\nconst start = Date.now();\n\nconst Colors: ChalkInstance = colors;\nconst NoColors = new Chalk({ level: 0 });\n\nexport function formatLogObject(\n\to: LogObject,\n\tctx: {\n\t\toptions: ConsolaOptions;\n\t},\n) {\n\tconst shouldColor = Boolean(ctx.options?.formatOptions?.colors);\n\n\tlet { date, type, tag } = o;\n\ttype = type === 'log' ? 'info' : type;\n\tconst colors = shouldColor ? Colors : NoColors;\n\tlet color = LevelColors[type] || colors.white;\n\tif (!shouldColor) {\n\t\tcolor = (v) => v;\n\t}\n\tconst levelText = levelShort[type] || type.toUpperCase().slice(0, 4); // Get first 4 chars, consistent uppercase\n\n\tlet line = '';\n\tlet out: string[] = [];\n\n\t// Timestamp\n\tif (isDevelopment) {\n\t\t// process.hrtime.bigint()\n\t\tlet diff = (date.getTime() - start) / 1000;\n\n\t\tout.push(colors.gray(diff.toFixed(3).padStart(7, ' ')));\n\t} else {\n\t\tout.push(colors.gray(dayjs(date).format('YYYY-MM-DD HH:mm:ss.SSS')));\n\t}\n\n\t// Log Level (colored)\n\t// Pad to 4 characters\n\tout.push(color(levelText.padEnd(4, ' ')));\n\n\tif (tag) {\n\t\tout.push(colors.yellow(`[${tag}]`)); // Added color for tag\n\t}\n\n\t{\n\t\tconst [message, ...additional] = formatArgs(o.args, { colors: shouldColor }).split('\\n');\n\n\t\tout.push(characterFormat(message));\n\n\t\tline = out.join(' ');\n\t\tif (additional.length > 0) {\n\t\t\tline += characterFormat(additional.join('\\n'));\n\t\t}\n\n\t\tif (type === 'trace') {\n\t\t\tconst _err = new Error(`Trace: ${o.message}`);\n\t\t\tline += formatStack(_err.stack || '', _err.message);\n\t\t}\n\t}\n\n\t// if (!message && typeof args[0] === 'string') {\n\t// message = args.shift();\n\t// }\n\t// if (message) {\n\t// out.push(message);\n\t// }\n\t// if (args.length) {\n\t// out.push(...args.map((a) => (typeof a === 'string' ? a : JSON.stringify(a)))); // Handle non-string args\n\t// }\n\n\t// todo format error\n\t// https://github.com/unjs/consola/blob/main/src/reporters/fancy.ts\n\n\t// return out.join(' '); // Increased spacing for better readability\n\treturn line;\n}\n\nfunction characterFormat(str: string) {\n\treturn (\n\t\tstr\n\t\t\t// highlight backticks\n\t\t\t.replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m))\n\t\t\t// underline underscores\n\t\t\t.replace(/\\s+_([^_]+)_\\s+/gm, (_, m) => ` ${colors.underline(m)} `)\n\t);\n}\n\nfunction parseStack(stack: string, message: string) {\n\t// const cwd = process.cwd() + sep;\n\n\tconst lines = stack\n\t\t.split('\\n')\n\t\t.splice(message.split('\\n').length)\n\t\t.map(\n\t\t\t(l) => l.trim().replace('file://', ''),\n\t\t\t// .replace(cwd, '')\n\t\t);\n\n\treturn lines;\n}\n\nfunction formatStack(stack: string, message: string, opts?: FormatOptions) {\n\tconst indent = ' '.repeat((opts?.errorLevel || 0) + 1);\n\treturn (\n\t\t`\\n${indent}` +\n\t\tparseStack(stack, message)\n\t\t\t.map(\n\t\t\t\t(line) =>\n\t\t\t\t\t` ${line.replace(/^at +/, (m) => colors.gray(m)).replace(/\\((.+)\\)/, (_, m) => `(${colors.cyan(m)})`)}`,\n\t\t\t)\n\t\t\t.join(`\\n${indent}`)\n\t);\n}\n\nfunction formatArgs(args: any[], opts: FormatOptions) {\n\tconst _args = args.map((arg) => {\n\t\tif (arg && typeof arg.stack === 'string') {\n\t\t\treturn formatError(arg, opts);\n\t\t}\n\t\treturn arg;\n\t});\n\n\t// Only supported with Node >= 10\n\t// https://nodejs.org/api/util.html#util_util_inspect_object_options\n\treturn formatWithOptions(Boolean(opts.colors), ..._args);\n}\n\nfunction formatWithOptions(shouldColor: boolean, ...params: any[]) {\n\treturn params.map((value) => formatValue(value, shouldColor)).join(' ');\n}\n\nfunction formatValue(value: any, shouldColor: boolean = false): string {\n\tconst colors = shouldColor ? Colors : NoColors;\n\n\tif (value === null) return 'null';\n\tif (value === undefined) return 'undefined';\n\tif (typeof value === 'string') return value;\n\tif (typeof value === 'number' || typeof value === 'boolean') return String(value);\n\n\tif (typeof value === 'object' && value.constructor === Object) {\n\t\tconst entries = Object.entries(value);\n\t\tif (entries.length === 0) return '{}';\n\t\treturn entries\n\t\t\t.map(([key, val]) => {\n\t\t\t\tconst keyStr = shouldColor ? colors.blue(key) : key;\n\t\t\t\tconst valStr = shouldColor ? colors.green(JSON.stringify(val)) : JSON.stringify(val);\n\t\t\t\treturn `${keyStr}=${valStr}`;\n\t\t\t})\n\t\t\t.join(' ');\n\t}\n\n\t// For arrays and other objects, use JSON.stringify directly\n\ttry {\n\t\tconst result = JSON.stringify(value);\n\t\treturn shouldColor ? colors.green(result) : result;\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n\nfunction formatError(err: any, opts: FormatOptions): string {\n\tconst message = err.message ?? formatWithOptions(Boolean(opts.colors), err);\n\tconst stack = err.stack ? formatStack(err.stack, message, opts) : '';\n\n\tconst level = opts?.errorLevel || 0;\n\tconst causedPrefix = level > 0 ? `${' '.repeat(level)}[cause]: ` : '';\n\tconst causedError = err.cause ? `\\n\\n${formatError(err.cause, { ...opts, errorLevel: level + 1 })}` : '';\n\n\treturn `${causedPrefix + message}\\n${stack}${causedError}`;\n}\n"],"names":["colors","Chalk","dayjs","isDevelopment","LevelColors","trace","gray","debug","cyan","info","blueBright","warn","yellow","error","red","fatal","bgRed","white","silent","log","success","green","fail","ready","start","box","verbose","levelShort","Date","now","Colors","NoColors","level","formatLogObject","o","ctx","shouldColor","Boolean","options","formatOptions","date","type","tag","color","v","levelText","toUpperCase","slice","line","out","diff","getTime","push","toFixed","padStart","format","padEnd","message","additional","formatArgs","args","split","characterFormat","join","length","_err","Error","formatStack","stack","str","replace","_","m","underline","parseStack","lines","splice","map","l","trim","opts","indent","repeat","errorLevel","_args","arg","formatError","formatWithOptions","params","value","formatValue","undefined","String","Object","entries","key","val","keyStr","blue","valStr","JSON","stringify","result","err","causedPrefix","causedError","cause"],"mappings":"AAAA,OAAOA,UAAUC,KAAK,QAA4B,QAAQ;AAE1D,OAAOC,WAAW,QAAQ;AAC1B,SAASC,aAAa,QAAQ,UAAU;AAExC,MAAMC,cAAwD;IAC7DC,OAAOL,OAAOM,IAAI;IAClBC,OAA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