@kikiutils/shared 18.3.0 → 19.0.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/README.md +0 -7
- package/dist/buffer.d.ts +0 -2
- package/dist/buffer.d.ts.map +1 -1
- package/dist/buffer.js +1 -2
- package/dist/classes/enhanced-date.d.ts +0 -2
- package/dist/classes/enhanced-date.d.ts.map +1 -1
- package/dist/classes/enhanced-date.js +1 -2
- package/dist/classes/path.d.ts +1 -3
- package/dist/classes/path.d.ts.map +1 -1
- package/dist/classes/path.js +1 -2
- package/dist/classes/precision-number.d.ts +0 -2
- package/dist/classes/precision-number.d.ts.map +1 -1
- package/dist/classes/precision-number.js +1 -2
- package/dist/clipboard.d.ts +0 -2
- package/dist/clipboard.d.ts.map +1 -1
- package/dist/clipboard.js +1 -2
- package/dist/crypto-hash.d.ts +0 -2
- package/dist/crypto-hash.d.ts.map +1 -1
- package/dist/crypto-hash.js +1 -2
- package/dist/datetime.d.ts +0 -2
- package/dist/datetime.d.ts.map +1 -1
- package/dist/datetime.js +1 -2
- package/dist/element-plus.d.ts +0 -2
- package/dist/element-plus.d.ts.map +1 -1
- package/dist/element-plus.js +1 -2
- package/dist/enum.d.ts +0 -2
- package/dist/enum.d.ts.map +1 -1
- package/dist/enum.js +1 -2
- package/dist/env.d.ts +0 -2
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +1 -2
- package/dist/event-awaiter.d.ts +0 -2
- package/dist/event-awaiter.d.ts.map +1 -1
- package/dist/event-awaiter.js +1 -2
- package/dist/file.d.ts +0 -2
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +1 -2
- package/dist/general.d.ts +0 -2
- package/dist/general.d.ts.map +1 -1
- package/dist/general.js +1 -2
- package/dist/hash.d.ts +0 -2
- package/dist/hash.d.ts.map +1 -1
- package/dist/hash.js +1 -2
- package/dist/logger/_internals/formatter.d.ts +13 -0
- package/dist/logger/_internals/formatter.d.ts.map +1 -0
- package/dist/logger/_internals/formatter.js +57 -0
- package/dist/logger/_internals/formatter.js.map +1 -0
- package/dist/logger/_internals/levels.d.ts +54 -0
- package/dist/logger/_internals/levels.d.ts.map +1 -0
- package/dist/logger/_internals/levels.js +59 -0
- package/dist/logger/_internals/levels.js.map +1 -0
- package/dist/logger/_internals/logger.d.ts +12 -0
- package/dist/logger/_internals/logger.d.ts.map +1 -0
- package/dist/logger/_internals/logger.js +147 -0
- package/dist/logger/_internals/logger.js.map +1 -0
- package/dist/logger/_internals/types.d.ts +12 -0
- package/dist/logger/_internals/types.d.ts.map +1 -0
- package/dist/logger/_internals/types.js +1 -0
- package/dist/logger/index.d.ts +10 -0
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/logger/index.js +25 -0
- package/dist/logger/index.js.map +1 -0
- package/dist/logger/node/_internals/file-writer.d.ts +11 -0
- package/dist/logger/node/_internals/file-writer.d.ts.map +1 -0
- package/dist/logger/node/_internals/file-writer.js +188 -0
- package/dist/logger/node/_internals/file-writer.js.map +1 -0
- package/dist/logger/node/_internals/formatter.d.ts +4 -0
- package/dist/logger/node/_internals/formatter.d.ts.map +1 -0
- package/dist/logger/node/_internals/formatter.js +21 -0
- package/dist/logger/node/_internals/formatter.js.map +1 -0
- package/dist/logger/node/index.d.ts +10 -0
- package/dist/logger/node/index.d.ts.map +1 -0
- package/dist/logger/node/index.js +122 -0
- package/dist/logger/node/index.js.map +1 -0
- package/dist/logger/node/types.d.ts +43 -0
- package/dist/logger/node/types.d.ts.map +1 -0
- package/dist/logger/node/types.js +1 -0
- package/dist/logger/types.d.ts +49 -0
- package/dist/logger/types.d.ts.map +1 -0
- package/dist/logger/types.js +1 -0
- package/dist/math.d.ts +0 -2
- package/dist/math.d.ts.map +1 -1
- package/dist/math.js +1 -2
- package/dist/number.d.ts +0 -2
- package/dist/number.d.ts.map +1 -1
- package/dist/number.js +1 -2
- package/dist/random.d.ts +0 -2
- package/dist/random.d.ts.map +1 -1
- package/dist/random.js +1 -2
- package/dist/redis/script-runner.d.ts +0 -2
- package/dist/redis/script-runner.d.ts.map +1 -1
- package/dist/redis/script-runner.js +1 -2
- package/dist/storages/lru/keyed-store.d.ts +0 -2
- package/dist/storages/lru/keyed-store.d.ts.map +1 -1
- package/dist/storages/lru/keyed-store.js +1 -2
- package/dist/storages/redis/keyed-store.d.ts +0 -2
- package/dist/storages/redis/keyed-store.d.ts.map +1 -1
- package/dist/storages/redis/keyed-store.js +1 -2
- package/dist/storages/redis/msgpack.d.ts +0 -2
- package/dist/storages/redis/msgpack.d.ts.map +1 -1
- package/dist/storages/redis/msgpack.js +1 -2
- package/dist/storages/redis/types.d.ts +0 -2
- package/dist/storages/redis/types.d.ts.map +1 -1
- package/dist/string.d.ts +0 -2
- package/dist/string.d.ts.map +1 -1
- package/dist/string.js +1 -2
- package/dist/time.d.ts +0 -2
- package/dist/time.d.ts.map +1 -1
- package/dist/time.js +1 -2
- package/dist/types/filtered-key-path.d.ts +0 -2
- package/dist/types/filtered-key-path.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -10
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/vue.d.ts +0 -2
- package/dist/types/vue.d.ts.map +1 -1
- package/dist/url.d.ts +0 -2
- package/dist/url.d.ts.map +1 -1
- package/dist/url.js +1 -2
- package/dist/vue.d.ts +0 -2
- package/dist/vue.d.ts.map +1 -1
- package/dist/vue.js +1 -2
- package/dist/web.d.ts +0 -2
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +1 -2
- package/package.json +73 -45
- package/src/logger/_internals/formatter.ts +80 -0
- package/src/logger/_internals/levels.ts +60 -0
- package/src/logger/_internals/logger.ts +224 -0
- package/src/logger/_internals/types.ts +12 -0
- package/src/logger/index.ts +34 -0
- package/src/logger/node/_internals/file-writer.ts +298 -0
- package/src/logger/node/_internals/formatter.ts +33 -0
- package/src/logger/node/index.ts +175 -0
- package/src/logger/node/types.ts +58 -0
- package/src/logger/types.ts +59 -0
- package/src/types/index.ts +0 -10
- package/dist/classes/ssh-client.d.ts +0 -40
- package/dist/classes/ssh-client.d.ts.map +0 -1
- package/dist/classes/ssh-client.js +0 -130
- package/dist/classes/ssh-client.js.map +0 -1
- package/dist/consola.d.ts +0 -24
- package/dist/consola.d.ts.map +0 -1
- package/dist/consola.js +0 -29
- package/dist/consola.js.map +0 -1
- package/dist/object.d.ts +0 -44
- package/dist/object.d.ts.map +0 -1
- package/dist/object.js +0 -59
- package/dist/object.js.map +0 -1
- package/dist/pino.d.ts +0 -25
- package/dist/pino.d.ts.map +0 -1
- package/dist/pino.js +0 -34
- package/dist/pino.js.map +0 -1
- package/src/classes/ssh-client.ts +0 -175
- package/src/consola.ts +0 -25
- package/src/object.ts +0 -78
- package/src/pino.ts +0 -33
package/README.md
CHANGED
|
@@ -16,7 +16,6 @@ A lightweight, modular TypeScript utility library for Node.js and browser projec
|
|
|
16
16
|
- 🔁 General helpers — normalize single-or-array values with `extractFirstValue`.
|
|
17
17
|
- 🧬 Binary helpers — convert `Blob`, `File`, `ArrayBuffer`, `Uint8Array`, and `Buffer` to Node `Buffer`.
|
|
18
18
|
- 🔒 Hashing helpers — SHA-3 helpers for universal usage and Node `crypto` MD5/SHA-3 helpers.
|
|
19
|
-
- 📜 Logging helpers — preconfigured Consola and Pino logger instances with env-based levels.
|
|
20
19
|
- 📅 Date helpers — format dates and compute common ranges such as today, this week, and last month.
|
|
21
20
|
- 🔢 Number and math helpers — compact number display, precise percentages, and fixed-decimal arithmetic.
|
|
22
21
|
- 🔤 String/random helpers — random strings and randomized-length value generation.
|
|
@@ -52,7 +51,6 @@ You can also use `npm`, `yarn`, or `bun`.
|
|
|
52
51
|
Import individual modules to keep dependency usage explicit:
|
|
53
52
|
|
|
54
53
|
```typescript
|
|
55
|
-
import { logger } from '@kikiutils/shared/consola';
|
|
56
54
|
import { extractFirstValue } from '@kikiutils/shared/general';
|
|
57
55
|
|
|
58
56
|
const value = extractFirstValue([
|
|
@@ -69,7 +67,6 @@ logger.info(value); // 0
|
|
|
69
67
|
| --- | --- | --- | --- |
|
|
70
68
|
| `buffer` | Node/browser-compatible inputs, Node output | `toBuffer` | Convert `Blob`, `File`, `ArrayBuffer`, `Uint8Array`, or `Buffer` to Node `Buffer`. |
|
|
71
69
|
| `clipboard` | Browser | `copyTextToClipboard`, `copyBlobToClipboard` | Safe result wrappers around the modern Clipboard API. |
|
|
72
|
-
| `consola` | Node/browser | `consolaLogger`, `logger` | Shared Consola instance with env-based log level. |
|
|
73
70
|
| `crypto-hash` | Node | `cryptoMd5`, `cryptoSha3*`, `*ToBuffer` | Node `crypto` MD5/SHA-3 helpers with text or raw-buffer output. |
|
|
74
71
|
| `datetime` | Node/browser | `formatDate`, `getDateRangeFromDate`, `getMidnightDateFromToday` | Date formatting and common date-range calculations via `date-fns`. |
|
|
75
72
|
| `element-plus` | Vue/browser | `createElFormItemRuleWithDefaults` | Create Element Plus form rules with default `required`, `trigger`, and `type`. |
|
|
@@ -80,8 +77,6 @@ logger.info(value); // 0
|
|
|
80
77
|
| `hash` | Any | `sha3224`, `sha3256`, `sha3384`, `sha3512` | SHA-3 helpers backed by `@noble/hashes`; returns hex strings. |
|
|
81
78
|
| `math` | Any | `toPercentageString` | Precise percentage strings using `decimal.js`. |
|
|
82
79
|
| `number` | Any | `toCompactNumberString` | Compact display strings using `millify`. |
|
|
83
|
-
| `object` | Any | `stringifyObjectDeterministically` | Stable flattened object serialization for signatures/cache keys. |
|
|
84
|
-
| `pino` | Node | `pinoLogger`, `logger` | Shared Pino logger with pretty output and env-based level. |
|
|
85
80
|
| `random` | Any | `generateWithNestedRandomLength` | Generate values with a two-step randomized length. |
|
|
86
81
|
| `string` | Any | `randomString` | Random strings from preset character sets. |
|
|
87
82
|
| `time` | Any | `abortableDelay` | Promise delay that resolves early on abort. |
|
|
@@ -158,8 +153,6 @@ Most modules are tiny wrappers around platform APIs or optional peers. If your p
|
|
|
158
153
|
| `element-plus` | `async-validator`, `element-plus` |
|
|
159
154
|
| `classes/precision-number`, `math` | `decimal.js` |
|
|
160
155
|
| `number` | `millify` |
|
|
161
|
-
| `consola` | `consola` |
|
|
162
|
-
| `pino` | `pino`, `pino-pretty` |
|
|
163
156
|
| `storages/lru/keyed-store` | `lru-cache` |
|
|
164
157
|
| `storages/redis/msgpack` | `msgpackr` |
|
|
165
158
|
| `vue` | `vue`, `vue-router` |
|
package/dist/buffer.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BinaryInput } from "./types/index.js";
|
|
2
2
|
import { Buffer } from "node:buffer";
|
|
3
|
-
//#region src/buffer.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Converts binary input to a Node.js `Buffer`.
|
|
6
5
|
*
|
|
@@ -31,5 +30,4 @@ import { Buffer } from "node:buffer";
|
|
|
31
30
|
* ```
|
|
32
31
|
*/
|
|
33
32
|
export declare function toBuffer(input: BinaryInput): Promise<Buffer<ArrayBufferLike>>;
|
|
34
|
-
//#endregion
|
|
35
33
|
//# sourceMappingURL=buffer.d.ts.map
|
package/dist/buffer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer.d.ts","names":[],"sources":["../src/buffer.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"buffer.d.ts","names":[],"sources":["../src/buffer.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiCsB,SAAS,OAAO,cAAW,QAAA,OAAA"}
|
package/dist/buffer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Buffer } from "node:buffer";
|
|
2
|
-
|
|
2
|
+
// src/buffer.ts
|
|
3
3
|
/**
|
|
4
4
|
* Converts binary input to a Node.js `Buffer`.
|
|
5
5
|
*
|
|
@@ -36,7 +36,6 @@ async function toBuffer(input) {
|
|
|
36
36
|
if (typeof input.arrayBuffer === "function") return Buffer.from(await input.arrayBuffer());
|
|
37
37
|
throw new TypeError("The provided input is not a supported binary type (Blob, Buffer, File, ArrayBuffer, or Uint8Array).");
|
|
38
38
|
}
|
|
39
|
-
//#endregion
|
|
40
39
|
export { toBuffer };
|
|
41
40
|
|
|
42
41
|
//# sourceMappingURL=buffer.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as dateFns from "date-fns";
|
|
2
|
-
//#region src/classes/enhanced-date.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* A mutable calendar date with chainable date-fns operations.
|
|
5
4
|
*
|
|
@@ -453,5 +452,4 @@ export declare class EnhancedDate extends Date {
|
|
|
453
452
|
*/
|
|
454
453
|
toSubYears(amount: number): EnhancedDate;
|
|
455
454
|
}
|
|
456
|
-
//#endregion
|
|
457
455
|
//# sourceMappingURL=enhanced-date.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhanced-date.d.ts","names":[],"sources":["../../src/classes/enhanced-date.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"enhanced-date.d.ts","names":[],"sources":["../../src/classes/enhanced-date.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA+Ba,qBAAqB;;;;SAMvB,cAAU;;;;SAOV,iBAAa;;;;SAOb,kBAAc;;;;;;;;;;;SAcd,WACH,eACA,iBACA,eAAe,QAAQ,QAAQ,OAC/B,UAAU,QAAQ,eAAY;;;;;;;;;SAa3B,QAAQ,eAAe,UAAU,QAAQ,kBAAe;;;;;;SASxD,gBAAgB,kBAAe;;;;;;;;SAW/B,IAAI,QAAQ,mBAAgB;;;;;;;;SAW5B,IAAI,QAAQ,mBAAgB;;;;SAO5B,gBAAY;;;;SAOZ,mBAAe;;;;SAOf,oBAAgB;;;;;;;;EAavB,QAAQ;;;;;;;;EAYR,SAAS;;;;;;;;EAYT,gBAAgB;;;;;;;;EAYhB,WAAW;;;;;;;;EAYX,UAAU;;;;;;;;EAYV,WAAW;;;;;;;;EAYX,SAAS;;;;;;;;EAYT,SAAS;;;;EAQT,SAAK;;;;;;;EAUL,yBAAyB,OAAO,QAAQ,QAA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Ac;;;;EAO3B,YAAY,iBAAc;;;;EAO1B,aAAa,iBAAc;;;;EAO3B,WAAW,iBAAc;;;;EAOzB,WAAW,iBAAc"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as dateFns from "date-fns";
|
|
2
|
-
|
|
2
|
+
// src/classes/enhanced-date.ts
|
|
3
3
|
/**
|
|
4
4
|
* A mutable calendar date with chainable date-fns operations.
|
|
5
5
|
*
|
|
@@ -629,7 +629,6 @@ var EnhancedDate = class EnhancedDate extends Date {
|
|
|
629
629
|
return this.clone().subYears(amount);
|
|
630
630
|
}
|
|
631
631
|
};
|
|
632
|
-
//#endregion
|
|
633
632
|
export { EnhancedDate };
|
|
634
633
|
|
|
635
634
|
//# sourceMappingURL=enhanced-date.js.map
|
package/dist/classes/path.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Buffer } from "node:buffer";
|
|
2
2
|
import * as fsp from "node:fs/promises";
|
|
3
3
|
import * as nodePath from "node:path";
|
|
4
|
-
import { Abortable } from "node:events";
|
|
5
4
|
import * as fs from "node:fs";
|
|
6
|
-
|
|
5
|
+
import { Abortable } from "node:events";
|
|
7
6
|
type DropFirstParameters<T extends (...args: any) => any> = Parameters<T> extends [any, ...infer R] ? R : never;
|
|
8
7
|
/**
|
|
9
8
|
* Values accepted by the `Path` constructor and path-composition methods.
|
|
@@ -359,6 +358,5 @@ export declare class Path {
|
|
|
359
358
|
*/
|
|
360
359
|
writeFile(...args: DropFirstParameters<typeof fsp.writeFile>): Promise<void>;
|
|
361
360
|
}
|
|
362
|
-
//#endregion
|
|
363
361
|
export {};
|
|
364
362
|
//# sourceMappingURL=path.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","names":[],"sources":["../../src/classes/path.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"path.d.ts","names":[],"sources":["../../src/classes/path.ts"],"mappings":";;;;;KAMK,oBAAoB,cAAc,qBAAqB,WA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ACX,SACI,UACK;IACC,UAAU;IACV,OAAO,GAAG;OAEZ,iBACL;EACH,SACI,WAEQ,YACA,GAAG;IACD,OAAO,GAAG;OAEd,wBAEP,QAAQ;;;;;;;;;;;EAeX,OAAO,SAAS,WAAQ;;;;;;;;;EAYxB,MAAM,MAAM,2BAA2B,IAAI,MAAG;;;;;;;;;EAY9C,SAAS,MAAM,2BAA2B,IAAI,SAAM;;;;;;;;;;EAapD,KACI,OAAO,GAAG;IACN;IACA;MAEL,QAAQ,GAAG;EACd,KACI,MAAM,GAAG;IACL;IACA;MAEL,QAAQ,GAAG;EACd,KACI,MAAM,GAAG;IACL;IACA;MAEL,QAAQ,GAAG;EACd,KACI,MAAM,GAAG;IACL;IACA;MAEL,QAAQ,GAAG;EACd,KAAK,MAAM,GAAG;IAAgB;MAA0B,QAAQ,GAAG,cAAc,GAAG;EACpF,KAAK,OAAO,GAAG,cAAc,QAAQ,GAAG,cAAc,GAAG;;;;;;;;;EAwBzD,YAAY,MAAM,2BAA2B,IAAI,YAAS;;;;;;;;;EAY1D,UAAM;;;;;;;;;EAYN,aAAa,MAAM,2BAA2B,IAAI,aAAU"}
|
package/dist/classes/path.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fsp from "node:fs/promises";
|
|
2
2
|
import * as nodePath from "node:path";
|
|
3
|
-
|
|
3
|
+
// src/classes/path.ts
|
|
4
4
|
/**
|
|
5
5
|
* An immutable file system path with Node.js path and file operations.
|
|
6
6
|
*
|
|
@@ -344,7 +344,6 @@ var Path = class Path {
|
|
|
344
344
|
return fsp.writeFile(this.#value, ...args);
|
|
345
345
|
}
|
|
346
346
|
};
|
|
347
|
-
//#endregion
|
|
348
347
|
export { Path };
|
|
349
348
|
|
|
350
349
|
//# sourceMappingURL=path.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Decimal } from "decimal.js";
|
|
2
|
-
//#region src/classes/precision-number.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Values accepted by `PrecisionNumber` constructors and arithmetic methods.
|
|
5
4
|
*/
|
|
@@ -262,5 +261,4 @@ export declare class PrecisionNumber {
|
|
|
262
261
|
*/
|
|
263
262
|
toTimes(value: PrecisionNumberValue): PrecisionNumber;
|
|
264
263
|
}
|
|
265
|
-
//#endregion
|
|
266
264
|
//# sourceMappingURL=precision-number.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"precision-number.d.ts","names":[],"sources":["../../src/classes/precision-number.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"precision-number.d.ts","names":[],"sources":["../../src/classes/precision-number.ts"],"mappings":";;;;YAKY,uBAAuB,QAAQ,QAAQ;EAAoB;;;;;;;;;;;;;;;;;;;;;;;;qBAwB1D;;;;;;;;;EAgBL,YAAA,QAAO,sBACP,wBACA,WAAU,QAAQ;;;;MAqBlB;;;;MAOA,YAAQ,QAAA;;;;MAOR;;;;;;;;;;SAeG,QACH,OAAO,sBACP,wBACA,WAAU,QAAQ;;;;;;GAmBrB,OAAO,aAAa;;;;;;EAUrB;;;;;;;;;EAaA;;;;;;;;;;;EAeA,MAAM,KAAK,sBAAsB,KAAK;;;;EAWtC,SAAK;;;;;;;;EAWL,UAAU,OAAO;;;;;;;;EAYjB,OAAO,OAAO;;;;;;;;;EAYd;;;;EAQA,GAAG,OAAO;;;;EAOV,IAAI,OAAO;;;;EAOX;;;;EAOA;;;;EAOA;;;;EAOA;;;;EAOA;;;;EAOA;;;;EAOA,GAAG,OAAO;;;;EAOV,IAAI,OAAO;;;;EAOX,MAAM,OAAO;;;;;;;;EAYb,OAAO,OAAO;;;;EAQd;;;;EAQA,KAAK,OAAO;;;;;;;;EAYZ,IAAI,OAAO;;;;EAQX,MAAM,OAAO;;;;EAQb,mBAAe;;;;EAOf,UAAM;;;;;;;;;EAYN,UAAU,KAAK,sBAAsB,KAAK,uBAAoB;;;;EAO9D,YAAY,OAAO,uBAAoB;;;;EAWvC,WAAO;;;;EAOP;;;;EAOA,QAAQ,OAAO,uBAAoB;;;;EAWnC,SAAS,OAAO,uBAAoB;;;;EAWpC,aAAS;;;;EAOT,OAAO,OAAO,uBAAoB;;;;EAOlC,MAAM,OAAO,uBAAoB;;;;;;;EAUjC;;;;EAOA;;;;EAOA,QAAQ,wBAA6C,WAAU,QAAQ;;;;EAOvE,QAAQ,OAAO,uBAAoB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Decimal } from "decimal.js";
|
|
2
|
-
|
|
2
|
+
// src/classes/precision-number.ts
|
|
3
3
|
/**
|
|
4
4
|
* A fixed-decimal number with mutable and immutable arithmetic operations.
|
|
5
5
|
*
|
|
@@ -375,7 +375,6 @@ var PrecisionNumber = class PrecisionNumber {
|
|
|
375
375
|
return new PrecisionNumber(this.#decimal.times(this.#valueToString(value)), this.#decimalPlaces, this.#rounding);
|
|
376
376
|
}
|
|
377
377
|
};
|
|
378
|
-
//#endregion
|
|
379
378
|
export { PrecisionNumber };
|
|
380
379
|
|
|
381
380
|
//# sourceMappingURL=precision-number.js.map
|
package/dist/clipboard.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/clipboard.d.ts
|
|
2
1
|
type CopyResult = {
|
|
3
2
|
error: unknown;
|
|
4
3
|
ok: false;
|
|
@@ -61,6 +60,5 @@ export declare function copyBlobToClipboard(blob: Blob, options?: ClipboardItemO
|
|
|
61
60
|
* ```
|
|
62
61
|
*/
|
|
63
62
|
export declare function copyTextToClipboard(text: string): Promise<CopyResult>;
|
|
64
|
-
//#endregion
|
|
65
63
|
export {};
|
|
66
64
|
//# sourceMappingURL=clipboard.d.ts.map
|
package/dist/clipboard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipboard.d.ts","names":[],"sources":["../src/clipboard.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"clipboard.d.ts","names":[],"sources":["../src/clipboard.ts"],"mappings":"A,KAAK;EACC;EAAgB;;EAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8BgB,oBAAoB,MAAM,MAAM,UAAU,uBAAuB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8CzE,oBAAoB,eAAe,QAAQ"}
|
package/dist/clipboard.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/clipboard.ts
|
|
2
2
|
/**
|
|
3
3
|
* Attempts to copy a blob to the browser clipboard.
|
|
4
4
|
*
|
|
@@ -80,7 +80,6 @@ async function copyTextToClipboard(text) {
|
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
//#endregion
|
|
84
83
|
export { copyBlobToClipboard, copyTextToClipboard };
|
|
85
84
|
|
|
86
85
|
//# sourceMappingURL=clipboard.js.map
|
package/dist/crypto-hash.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BinaryLike } from "node:crypto";
|
|
2
|
-
//#region src/crypto-hash.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Computes the MD5 hash of the given data.
|
|
5
4
|
*
|
|
@@ -165,5 +164,4 @@ export declare function cryptoSha3512(data: BinaryLike, outputEncoding?: BufferE
|
|
|
165
164
|
* ```
|
|
166
165
|
*/
|
|
167
166
|
export declare function cryptoSha3512ToBuffer(data: BinaryLike): NonSharedBuffer;
|
|
168
|
-
//#endregion
|
|
169
167
|
//# sourceMappingURL=crypto-hash.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto-hash.d.ts","names":[],"sources":["../src/crypto-hash.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"crypto-hash.d.ts","names":[],"sources":["../src/crypto-hash.ts"],"mappings":";;;;;;;;;;;;;;;;;wBAoBgB,UAAU,MAAM,YAAY,iBAAgB;;;;;;;;;;;;;;;;wBAmB5C,kBAAkB,MAAM,aAAU;;;;;;;;;;;;;;;;;wBAoBlC,cAAc,MAAM,YAAY,iBAAgB;;;;;;;;;;;;;;;;wBAmBhD,sBAAsB,MAAM,aAAU;;;;;;;;;;;;;;;;;wBAoBtC,cAAc,MAAM,YAAY,iBAAgB;;;;;;;;;;;;;;;;wBAmBhD,sBAAsB,MAAM,aAAU;;;;;;;;;;;;;;;;;wBAoBtC,cAAc,MAAM,YAAY,iBAAgB;;;;;;;;;;;;;;;;wBAmBhD,sBAAsB,MAAM,aAAU;;;;;;;;;;;;;;;;;wBAoBtC,cAAc,MAAM,YAAY,iBAAgB;;;;;;;;;;;;;;;;wBAmBhD,sBAAsB,MAAM,aAAU"}
|
package/dist/crypto-hash.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Buffer } from "node:buffer";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
|
-
|
|
3
|
+
// src/crypto-hash.ts
|
|
4
4
|
/**
|
|
5
5
|
* Computes the MD5 hash of the given data.
|
|
6
6
|
*
|
|
@@ -189,7 +189,6 @@ function cryptoSha3512ToBuffer(data) {
|
|
|
189
189
|
function normalizeHashData(data) {
|
|
190
190
|
return typeof data === "string" || ArrayBuffer.isView(data) ? data : Buffer.from(data);
|
|
191
191
|
}
|
|
192
|
-
//#endregion
|
|
193
192
|
export { cryptoMd5, cryptoMd5ToBuffer, cryptoSha3224, cryptoSha3224ToBuffer, cryptoSha3256, cryptoSha3256ToBuffer, cryptoSha3384, cryptoSha3384ToBuffer, cryptoSha3512, cryptoSha3512ToBuffer };
|
|
194
193
|
|
|
195
194
|
//# sourceMappingURL=crypto-hash.js.map
|
package/dist/datetime.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EnhancedDate } from "./classes/enhanced-date.js";
|
|
2
2
|
import * as dateFns from "date-fns";
|
|
3
|
-
//#region src/datetime.d.ts
|
|
4
3
|
export type DateRangeType = 'lastMonth' | 'lastWeek' | 'thisMonth' | 'thisWeek' | 'today' | 'yesterday';
|
|
5
4
|
/**
|
|
6
5
|
* Formats a date using a date-fns pattern without changing the input.
|
|
@@ -67,5 +66,4 @@ export declare function getDateRangeFromDate(date: Date, type: DateRangeType, op
|
|
|
67
66
|
* @returns A new `EnhancedDate` at local midnight on the selected day.
|
|
68
67
|
*/
|
|
69
68
|
export declare function getMidnightDateFromToday(offsetDays?: number): EnhancedDate;
|
|
70
|
-
//#endregion
|
|
71
69
|
//# sourceMappingURL=datetime.d.ts.map
|
package/dist/datetime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datetime.d.ts","names":[],"sources":["../src/datetime.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"datetime.d.ts","names":[],"sources":["../src/datetime.ts"],"mappings":";;YAIY;;;;;;;;;;;;;;;;;;;;;;;wBAwBI,WACZ,MAAM,QAAQ,QAAQ,OACtB,iBACA,UAAU,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAkCN,qBACZ,MAAM,MACN,MAAM,eACN;EACI;EACA,eAAe,QAAQ;;;;;;;;;;;;wBA8Df,yBAAyB,sBAAsB"}
|
package/dist/datetime.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EnhancedDate } from "./classes/enhanced-date.js";
|
|
2
2
|
import * as dateFns from "date-fns";
|
|
3
|
-
|
|
3
|
+
// src/datetime.ts
|
|
4
4
|
/**
|
|
5
5
|
* Formats a date using a date-fns pattern without changing the input.
|
|
6
6
|
*
|
|
@@ -109,7 +109,6 @@ function getDateRangeFromDate(date, type, options) {
|
|
|
109
109
|
function getMidnightDateFromToday(offsetDays = 0) {
|
|
110
110
|
return new EnhancedDate().addDays(offsetDays).startOfDay();
|
|
111
111
|
}
|
|
112
|
-
//#endregion
|
|
113
112
|
export { formatDate, getDateRangeFromDate, getMidnightDateFromToday };
|
|
114
113
|
|
|
115
114
|
//# sourceMappingURL=datetime.js.map
|
package/dist/element-plus.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RuleType } from "async-validator";
|
|
2
2
|
import { FormItemRule } from "element-plus";
|
|
3
|
-
//#region src/element-plus.d.ts
|
|
4
3
|
export type DoNotRemoveOrUseThisType = RuleType;
|
|
5
4
|
/**
|
|
6
5
|
* Creates a new Element Plus form validation rule with overridable defaults.
|
|
@@ -26,5 +25,4 @@ export type DoNotRemoveOrUseThisType = RuleType;
|
|
|
26
25
|
* ```
|
|
27
26
|
*/
|
|
28
27
|
export declare function createElFormItemRuleWithDefaults(message: FormItemRule['message'], options?: FormItemRule): FormItemRule;
|
|
29
|
-
//#endregion
|
|
30
28
|
//# sourceMappingURL=element-plus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-plus.d.ts","names":[],"sources":["../src/element-plus.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"element-plus.d.ts","names":[],"sources":["../src/element-plus.ts"],"mappings":";;YAGY,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;wBAyBvB,iCACZ,SAAS,yBACT,UAAS,eACV"}
|
package/dist/element-plus.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/element-plus.ts
|
|
2
2
|
/**
|
|
3
3
|
* Creates a new Element Plus form validation rule with overridable defaults.
|
|
4
4
|
*
|
|
@@ -31,7 +31,6 @@ function createElFormItemRuleWithDefaults(message, options = {}) {
|
|
|
31
31
|
type: options.type ?? "string"
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { createElFormItemRuleWithDefaults };
|
|
36
35
|
|
|
37
36
|
//# sourceMappingURL=element-plus.js.map
|
package/dist/enum.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/enum.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Extracts only the numeric values from an enumeration-like object.
|
|
4
3
|
*
|
|
@@ -98,5 +97,4 @@ export declare function getEnumStringValues<T extends Record<string, any>>(enumO
|
|
|
98
97
|
* ```
|
|
99
98
|
*/
|
|
100
99
|
export declare function getEnumValues<T extends Record<string, any>>(enumObject: T): (T[keyof T])[];
|
|
101
|
-
//#endregion
|
|
102
100
|
//# sourceMappingURL=enum.d.ts.map
|
package/dist/enum.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.d.ts","names":[],"sources":["../src/enum.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"enum.d.ts","names":[],"sources":["../src/enum.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;wBAwBgB,oBAAoB,UAAU,qBAAqB,YAAY,IAAI,QAAQ,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;wBA4BnF,oBAAoB,UAAU,qBAAqB,YAAY,IAAI,QAAQ,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAoDnF,cAAc,UAAU,qBAAqB,YAAY,KAAK,QAAQ"}
|
package/dist/enum.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/enum.ts
|
|
2
2
|
/**
|
|
3
3
|
* Extracts only the numeric values from an enumeration-like object.
|
|
4
4
|
*
|
|
@@ -106,7 +106,6 @@ function getEnumValues(enumObject) {
|
|
|
106
106
|
if (!values.some((value) => typeof value === "number")) return values;
|
|
107
107
|
return Object.keys(enumObject).filter((key) => Number.isNaN(Number(key))).map((key) => enumObject[key]);
|
|
108
108
|
}
|
|
109
|
-
//#endregion
|
|
110
109
|
export { getEnumNumberValues, getEnumStringValues, getEnumValues };
|
|
111
110
|
|
|
112
111
|
//# sourceMappingURL=enum.js.map
|
package/dist/env.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/env.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Custom error class for handling missing environment variables.
|
|
4
3
|
*
|
|
@@ -47,5 +46,4 @@ export declare class EnvironmentNotFoundError extends Error {
|
|
|
47
46
|
* ```
|
|
48
47
|
*/
|
|
49
48
|
export declare function checkAndGetEnvValue(key: string): string;
|
|
50
|
-
//#endregion
|
|
51
49
|
//# sourceMappingURL=env.d.ts.map
|
package/dist/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","names":[],"sources":["../src/env.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"env.d.ts","names":[],"sources":["../src/env.ts"],"mappings":";;;;;;qBAMa,iCAAiC;WACjC;;;;;;EAOG,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwCA,oBAAoB"}
|
package/dist/env.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/env.ts
|
|
2
2
|
/**
|
|
3
3
|
* Custom error class for handling missing environment variables.
|
|
4
4
|
*
|
|
@@ -55,7 +55,6 @@ function checkAndGetEnvValue(key) {
|
|
|
55
55
|
if (process.env[key] === void 0) throw new EnvironmentNotFoundError(key);
|
|
56
56
|
return process.env[key];
|
|
57
57
|
}
|
|
58
|
-
//#endregion
|
|
59
58
|
export { EnvironmentNotFoundError, checkAndGetEnvValue };
|
|
60
59
|
|
|
61
60
|
//# sourceMappingURL=env.js.map
|
package/dist/event-awaiter.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/event-awaiter.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* An asynchronous keyed event rendezvous for one or more waiting consumers.
|
|
4
3
|
*
|
|
@@ -75,5 +74,4 @@ export declare class EventAwaiter<T> {
|
|
|
75
74
|
*/
|
|
76
75
|
waitLatest(key: string, timeoutMs?: number, signal?: AbortSignal): Promise<T | undefined>;
|
|
77
76
|
}
|
|
78
|
-
//#endregion
|
|
79
77
|
//# sourceMappingURL=event-awaiter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-awaiter.d.ts","names":[],"sources":["../src/event-awaiter.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-awaiter.d.ts","names":[],"sources":["../src/event-awaiter.ts"],"mappings":";;;;;;;;;;;qBAWa,aAAa;;;;;;;;EAYtB,QAAQ,aAAa,OAAO;;;;;;EAa5B,WAAW,QAAO;;;;;;;;;;;;;;;;;;;;EAwBlB,KAAK,aAAa,oBAAoB,8BAA8B,SAAS,cAAW,QAAA;;;;;;;;;;;;;;EA8DxF,cAAc,aAAa,oBAAoB,SAAS,cAAW,QAAA;;;;;;;;;;;;;;;EAkBnE,WAAW,aAAa,oBAAoB,SAAS,cAAW,QAAA"}
|
package/dist/event-awaiter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/event-awaiter.ts
|
|
2
2
|
/**
|
|
3
3
|
* An asynchronous keyed event rendezvous for one or more waiting consumers.
|
|
4
4
|
*
|
|
@@ -119,7 +119,6 @@ var EventAwaiter = class {
|
|
|
119
119
|
return this.wait(key, timeoutMs, "override", signal);
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
|
-
//#endregion
|
|
123
122
|
export { EventAwaiter };
|
|
124
123
|
|
|
125
124
|
//# sourceMappingURL=event-awaiter.js.map
|
package/dist/file.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BinaryInput } from "./types/index.js";
|
|
2
|
-
//#region src/file.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Detects a lowercase MIME type from binary content rather than its name or declared type.
|
|
5
4
|
*
|
|
@@ -23,5 +22,4 @@ import { BinaryInput } from "./types/index.js";
|
|
|
23
22
|
* ```
|
|
24
23
|
*/
|
|
25
24
|
export declare function getFileMimeType(input: BinaryInput): Promise<string | undefined>;
|
|
26
|
-
//#endregion
|
|
27
25
|
//# sourceMappingURL=file.d.ts.map
|
package/dist/file.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","names":[],"sources":["../src/file.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"file.d.ts","names":[],"sources":["../src/file.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;wBA6BsB,gBAAgB,OAAO,cAAW"}
|
package/dist/file.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileTypeFromBlob, fileTypeFromBuffer } from "file-type";
|
|
2
|
-
|
|
2
|
+
// src/file.ts
|
|
3
3
|
/**
|
|
4
4
|
* Detects a lowercase MIME type from binary content rather than its name or declared type.
|
|
5
5
|
*
|
|
@@ -25,7 +25,6 @@ import { fileTypeFromBlob, fileTypeFromBuffer } from "file-type";
|
|
|
25
25
|
async function getFileMimeType(input) {
|
|
26
26
|
return (input instanceof ArrayBuffer || input instanceof Uint8Array ? await fileTypeFromBuffer(input) : await fileTypeFromBlob(input))?.mime.toLowerCase();
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
export { getFileMimeType };
|
|
30
29
|
|
|
31
30
|
//# sourceMappingURL=file.js.map
|
package/dist/general.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/general.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Returns the first array element or the input value, with a nullish fallback.
|
|
4
3
|
*
|
|
@@ -32,5 +31,4 @@
|
|
|
32
31
|
*/
|
|
33
32
|
export declare function extractFirstValue<T>(value: T | T[]): T | undefined;
|
|
34
33
|
export declare function extractFirstValue<T, D>(value: T | T[], defaultValue: D): D | NonNullable<T>;
|
|
35
|
-
//#endregion
|
|
36
34
|
//# sourceMappingURL=general.d.ts.map
|
package/dist/general.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","names":[],"sources":["../src/general.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"general.d.ts","names":[],"sources":["../src/general.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiCgB,kBAAkB,GAAG,OAAO,IAAI,MAAM;wBACtC,kBAAkB,GAAG,GAAG,OAAO,IAAI,KAAK,cAAc,IAAI,IAAI,YAAY"}
|
package/dist/general.js
CHANGED
package/dist/hash.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/hash.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Computes the SHA-3 hash of the given data using the 224-bit digest.
|
|
4
3
|
*
|
|
@@ -63,5 +62,4 @@ export declare function sha3384(data: string | Uint8Array): string;
|
|
|
63
62
|
* ```
|
|
64
63
|
*/
|
|
65
64
|
export declare function sha3512(data: string | Uint8Array): string;
|
|
66
|
-
//#endregion
|
|
67
65
|
//# sourceMappingURL=hash.d.ts.map
|
package/dist/hash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.d.ts","names":[],"sources":["../src/hash.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"hash.d.ts","names":[],"sources":["../src/hash.ts"],"mappings":";;;;;;;;;;;;;;;wBA0BgB,QAAQ,eAAe;;;;;;;;;;;;;;;;wBAmBvB,QAAQ,eAAe;;;;;;;;;;;;;;;;wBAmBvB,QAAQ,eAAe;;;;;;;;;;;;;;;;wBAmBvB,QAAQ,eAAe"}
|
package/dist/hash.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sha3_224, sha3_256, sha3_384, sha3_512 } from "@noble/hashes/sha3.js";
|
|
2
2
|
import { bytesToHex, utf8ToBytes } from "@noble/hashes/utils.js";
|
|
3
|
-
|
|
3
|
+
// src/hash.ts
|
|
4
4
|
/**
|
|
5
5
|
* Computes the SHA-3 hash of the given data using the 224-bit digest.
|
|
6
6
|
*
|
|
@@ -73,7 +73,6 @@ function sha3384(data) {
|
|
|
73
73
|
function sha3512(data) {
|
|
74
74
|
return bytesToHex(sha3_512(typeof data === "string" ? utf8ToBytes(data) : data));
|
|
75
75
|
}
|
|
76
|
-
//#endregion
|
|
77
76
|
export { sha3224, sha3256, sha3384, sha3512 };
|
|
78
77
|
|
|
79
78
|
//# sourceMappingURL=hash.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LoggerRecord } from "./types.js";
|
|
2
|
+
/** Native console formatting keeps user strings literal and objects expandable. */
|
|
3
|
+
export declare function formatLoggerConsoleArgs(record: LoggerRecord): unknown[];
|
|
4
|
+
/** Keeps data arguments intact so browser developer tools can expand objects. */
|
|
5
|
+
export declare function formatLoggerParts(record: LoggerRecord, colors?: boolean): unknown[];
|
|
6
|
+
/** Fixed local-time representation, deliberately without a per-second cache. */
|
|
7
|
+
export declare function formatLoggerTime(date: Date): string;
|
|
8
|
+
/** Use native terminal detection; redirected streams still honor FORCE_COLOR. */
|
|
9
|
+
export declare function supportsLoggerColor(target: {
|
|
10
|
+
hasColors?: () => boolean;
|
|
11
|
+
isTTY?: boolean;
|
|
12
|
+
}): boolean;
|
|
13
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","names":[],"sources":["../../../src/logger/_internals/formatter.ts"],"mappings":";;wBASgB,wBAAwB,QAAQ;;wBAiChC,kBAAkB,QAAQ,cAAc;;wBAYxC,iBAAiB,MAAM;;wBAQvB,oBAAoB;EAAU;EAA2B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { getLoggerStreamName, loggerMethods } from "./levels.js";
|
|
2
|
+
// src/logger/_internals/formatter.ts
|
|
3
|
+
/** Native console formatting keeps user strings literal and objects expandable. */
|
|
4
|
+
function formatLoggerConsoleArgs(record) {
|
|
5
|
+
if (typeof process !== "undefined" && process.versions?.node) {
|
|
6
|
+
const target = process[getLoggerStreamName(record.type)];
|
|
7
|
+
const parts = formatLoggerParts(record, supportsLoggerColor(target));
|
|
8
|
+
return [parts.map((part) => typeof part === "string" ? "%s" : "%O").join(" "), ...parts];
|
|
9
|
+
}
|
|
10
|
+
const format = [];
|
|
11
|
+
const args = [];
|
|
12
|
+
const decorate = (text, color) => {
|
|
13
|
+
format.push("%c%s%c");
|
|
14
|
+
args.push(`color: ${color}`, text, "");
|
|
15
|
+
};
|
|
16
|
+
if (record.icons) decorate(loggerMethods[record.type].icon, loggerMethods[record.type].cssColor);
|
|
17
|
+
if (record.timestamp) decorate(formatLoggerTime(record.date), "#808080");
|
|
18
|
+
if (record.prefix) decorate(record.prefix, "#0891b2");
|
|
19
|
+
for (const arg of record.args) {
|
|
20
|
+
format.push(typeof arg === "string" ? "%s" : "%o");
|
|
21
|
+
args.push(arg);
|
|
22
|
+
}
|
|
23
|
+
if (record.suffix) decorate(record.suffix, "#0891b2");
|
|
24
|
+
return [format.join(" "), ...args];
|
|
25
|
+
}
|
|
26
|
+
/** Keeps data arguments intact so browser developer tools can expand objects. */
|
|
27
|
+
function formatLoggerParts(record, colors = false) {
|
|
28
|
+
const parts = [];
|
|
29
|
+
const paint = (text, color) => colors ? `\u001B[${color}m${text}\u001B[0m` : text;
|
|
30
|
+
if (record.icons) parts.push(paint(loggerMethods[record.type].icon, loggerMethods[record.type].ansiColor));
|
|
31
|
+
if (record.timestamp) parts.push(paint(formatLoggerTime(record.date), "90"));
|
|
32
|
+
if (record.prefix) parts.push(paint(record.prefix, "36"));
|
|
33
|
+
parts.push(...record.args);
|
|
34
|
+
if (record.suffix) parts.push(paint(record.suffix, "36"));
|
|
35
|
+
return parts;
|
|
36
|
+
}
|
|
37
|
+
/** Fixed local-time representation, deliberately without a per-second cache. */
|
|
38
|
+
function formatLoggerTime(date) {
|
|
39
|
+
const pad = (value, width = 2) => String(value).padStart(width, "0");
|
|
40
|
+
return `[${`${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`} ${`${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`}.${pad(date.getMilliseconds(), 3)}]`;
|
|
41
|
+
}
|
|
42
|
+
/** Use native terminal detection; redirected streams still honor FORCE_COLOR. */
|
|
43
|
+
function supportsLoggerColor(target) {
|
|
44
|
+
if (target.hasColors) return target.hasColors();
|
|
45
|
+
const forced = process.env.FORCE_COLOR;
|
|
46
|
+
if (forced !== void 0) return [
|
|
47
|
+
"",
|
|
48
|
+
"1",
|
|
49
|
+
"2",
|
|
50
|
+
"3",
|
|
51
|
+
"true"
|
|
52
|
+
].includes(forced);
|
|
53
|
+
return Boolean(target.isTTY) && !process.env.NO_COLOR && !process.env.NODE_DISABLE_COLORS && process.env.TERM !== "dumb";
|
|
54
|
+
}
|
|
55
|
+
export { formatLoggerConsoleArgs, formatLoggerParts, formatLoggerTime, supportsLoggerColor };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.js","names":[],"sources":["../../../src/logger/_internals/formatter.ts"],"sourcesContent":["import {\n getLoggerStreamName,\n loggerMethods,\n} from './levels';\nimport type { LoggerRecord } from './types';\n\n// Functions\n\n/** Native console formatting keeps user strings literal and objects expandable. */\nexport function formatLoggerConsoleArgs(record: LoggerRecord): unknown[] {\n if (typeof process !== 'undefined' && process.versions?.node) {\n const target = process[getLoggerStreamName(record.type)];\n const parts = formatLoggerParts(record, supportsLoggerColor(target));\n return [\n parts.map((part) => typeof part === 'string' ? '%s' : '%O').join(' '),\n ...parts,\n ];\n }\n\n const format: string[] = [];\n const args: unknown[] = [];\n const decorate = (text: string, color: string) => {\n format.push('%c%s%c');\n args.push(`color: ${color}`, text, '');\n };\n\n if (record.icons) decorate(loggerMethods[record.type].icon, loggerMethods[record.type].cssColor);\n if (record.timestamp) decorate(formatLoggerTime(record.date), '#808080');\n if (record.prefix) decorate(record.prefix, '#0891b2');\n for (const arg of record.args) {\n format.push(typeof arg === 'string' ? '%s' : '%o');\n args.push(arg);\n }\n\n if (record.suffix) decorate(record.suffix, '#0891b2');\n return [\n format.join(' '),\n ...args,\n ];\n}\n\n/** Keeps data arguments intact so browser developer tools can expand objects. */\nexport function formatLoggerParts(record: LoggerRecord, colors = false): unknown[] {\n const parts: unknown[] = [];\n const paint = (text: string, color: string) => colors ? `\\u001B[${color}m${text}\\u001B[0m` : text;\n if (record.icons) parts.push(paint(loggerMethods[record.type].icon, loggerMethods[record.type].ansiColor));\n if (record.timestamp) parts.push(paint(formatLoggerTime(record.date), '90'));\n if (record.prefix) parts.push(paint(record.prefix, '36'));\n parts.push(...record.args);\n if (record.suffix) parts.push(paint(record.suffix, '36'));\n return parts;\n}\n\n/** Fixed local-time representation, deliberately without a per-second cache. */\nexport function formatLoggerTime(date: Date): string {\n const pad = (value: number, width = 2) => String(value).padStart(width, '0');\n const day = `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;\n const time = `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;\n return `[${day} ${time}.${pad(date.getMilliseconds(), 3)}]`;\n}\n\n/** Use native terminal detection; redirected streams still honor FORCE_COLOR. */\nexport function supportsLoggerColor(target: { hasColors?: () => boolean; isTTY?: boolean }): boolean {\n if (target.hasColors) return target.hasColors();\n const forced = process.env.FORCE_COLOR;\n if (forced !== undefined) {\n return [\n '',\n '1',\n '2',\n '3',\n 'true',\n ].includes(forced);\n }\n\n return Boolean(target.isTTY)\n && !process.env.NO_COLOR\n && !process.env.NODE_DISABLE_COLORS\n && process.env.TERM !== 'dumb';\n}\n"],"mappings":";;;AASA,SAAgB,wBAAwB,QAAiC;CACrE,IAAI,OAAO,YAAY,eAAe,QAAQ,UAAU,MAAM;EAC1D,MAAM,SAAS,QAAQ,oBAAoB,OAAO,IAAI;EACtD,MAAM,QAAQ,kBAAkB,QAAQ,oBAAoB,MAAM,CAAC;EACnE,OAAO,CACH,MAAM,KAAK,SAAS,OAAO,SAAS,WAAW,OAAO,IAAI,CAAC,CAAC,KAAK,GAAG,GACpE,GAAG,KACP;CACJ;CAEA,MAAM,SAAmB,CAAC;CAC1B,MAAM,OAAkB,CAAC;CACzB,MAAM,YAAY,MAAc,UAAkB;EAC9C,OAAO,KAAK,QAAQ;EACpB,KAAK,KAAK,UAAU,SAAS,MAAM,E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