@kikiutils/shared 18.2.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.
Files changed (160) hide show
  1. package/README.md +0 -7
  2. package/dist/buffer.d.ts +0 -2
  3. package/dist/buffer.d.ts.map +1 -1
  4. package/dist/buffer.js +1 -2
  5. package/dist/classes/enhanced-date.d.ts +0 -2
  6. package/dist/classes/enhanced-date.d.ts.map +1 -1
  7. package/dist/classes/enhanced-date.js +1 -2
  8. package/dist/classes/path.d.ts +2 -3
  9. package/dist/classes/path.d.ts.map +1 -1
  10. package/dist/classes/path.js +1 -2
  11. package/dist/classes/precision-number.d.ts +0 -2
  12. package/dist/classes/precision-number.d.ts.map +1 -1
  13. package/dist/classes/precision-number.js +1 -2
  14. package/dist/clipboard.d.ts +1 -2
  15. package/dist/clipboard.d.ts.map +1 -1
  16. package/dist/clipboard.js +1 -2
  17. package/dist/crypto-hash.d.ts +0 -2
  18. package/dist/crypto-hash.d.ts.map +1 -1
  19. package/dist/crypto-hash.js +1 -2
  20. package/dist/datetime.d.ts +0 -2
  21. package/dist/datetime.d.ts.map +1 -1
  22. package/dist/datetime.js +1 -2
  23. package/dist/element-plus.d.ts +0 -2
  24. package/dist/element-plus.d.ts.map +1 -1
  25. package/dist/element-plus.js +1 -2
  26. package/dist/enum.d.ts +0 -2
  27. package/dist/enum.d.ts.map +1 -1
  28. package/dist/enum.js +1 -2
  29. package/dist/env.d.ts +0 -2
  30. package/dist/env.d.ts.map +1 -1
  31. package/dist/env.js +1 -2
  32. package/dist/event-awaiter.d.ts +0 -2
  33. package/dist/event-awaiter.d.ts.map +1 -1
  34. package/dist/event-awaiter.js +1 -2
  35. package/dist/file.d.ts +25 -0
  36. package/dist/file.d.ts.map +1 -0
  37. package/dist/file.js +30 -0
  38. package/dist/file.js.map +1 -0
  39. package/dist/general.d.ts +0 -2
  40. package/dist/general.d.ts.map +1 -1
  41. package/dist/general.js +1 -2
  42. package/dist/hash.d.ts +0 -2
  43. package/dist/hash.d.ts.map +1 -1
  44. package/dist/hash.js +1 -2
  45. package/dist/logger/_internals/formatter.d.ts +13 -0
  46. package/dist/logger/_internals/formatter.d.ts.map +1 -0
  47. package/dist/logger/_internals/formatter.js +57 -0
  48. package/dist/logger/_internals/formatter.js.map +1 -0
  49. package/dist/logger/_internals/levels.d.ts +54 -0
  50. package/dist/logger/_internals/levels.d.ts.map +1 -0
  51. package/dist/logger/_internals/levels.js +59 -0
  52. package/dist/logger/_internals/levels.js.map +1 -0
  53. package/dist/logger/_internals/logger.d.ts +12 -0
  54. package/dist/logger/_internals/logger.d.ts.map +1 -0
  55. package/dist/logger/_internals/logger.js +147 -0
  56. package/dist/logger/_internals/logger.js.map +1 -0
  57. package/dist/logger/_internals/types.d.ts +12 -0
  58. package/dist/logger/_internals/types.d.ts.map +1 -0
  59. package/dist/logger/_internals/types.js +1 -0
  60. package/dist/logger/index.d.ts +10 -0
  61. package/dist/logger/index.d.ts.map +1 -0
  62. package/dist/logger/index.js +25 -0
  63. package/dist/logger/index.js.map +1 -0
  64. package/dist/logger/node/_internals/file-writer.d.ts +11 -0
  65. package/dist/logger/node/_internals/file-writer.d.ts.map +1 -0
  66. package/dist/logger/node/_internals/file-writer.js +188 -0
  67. package/dist/logger/node/_internals/file-writer.js.map +1 -0
  68. package/dist/logger/node/_internals/formatter.d.ts +4 -0
  69. package/dist/logger/node/_internals/formatter.d.ts.map +1 -0
  70. package/dist/logger/node/_internals/formatter.js +21 -0
  71. package/dist/logger/node/_internals/formatter.js.map +1 -0
  72. package/dist/logger/node/index.d.ts +10 -0
  73. package/dist/logger/node/index.d.ts.map +1 -0
  74. package/dist/logger/node/index.js +122 -0
  75. package/dist/logger/node/index.js.map +1 -0
  76. package/dist/logger/node/types.d.ts +43 -0
  77. package/dist/logger/node/types.d.ts.map +1 -0
  78. package/dist/logger/node/types.js +1 -0
  79. package/dist/logger/types.d.ts +49 -0
  80. package/dist/logger/types.d.ts.map +1 -0
  81. package/dist/logger/types.js +1 -0
  82. package/dist/math.d.ts +1 -2
  83. package/dist/math.d.ts.map +1 -1
  84. package/dist/math.js +1 -2
  85. package/dist/number.d.ts +0 -2
  86. package/dist/number.d.ts.map +1 -1
  87. package/dist/number.js +1 -2
  88. package/dist/random.d.ts +0 -2
  89. package/dist/random.d.ts.map +1 -1
  90. package/dist/random.js +1 -2
  91. package/dist/redis/script-runner.d.ts +0 -2
  92. package/dist/redis/script-runner.d.ts.map +1 -1
  93. package/dist/redis/script-runner.js +1 -2
  94. package/dist/storages/lru/keyed-store.d.ts +2 -2
  95. package/dist/storages/lru/keyed-store.d.ts.map +1 -1
  96. package/dist/storages/lru/keyed-store.js +6 -3
  97. package/dist/storages/lru/keyed-store.js.map +1 -1
  98. package/dist/storages/redis/keyed-store.d.ts +0 -2
  99. package/dist/storages/redis/keyed-store.d.ts.map +1 -1
  100. package/dist/storages/redis/keyed-store.js +1 -2
  101. package/dist/storages/redis/msgpack.d.ts +0 -2
  102. package/dist/storages/redis/msgpack.d.ts.map +1 -1
  103. package/dist/storages/redis/msgpack.js +1 -2
  104. package/dist/storages/redis/types.d.ts +0 -2
  105. package/dist/storages/redis/types.d.ts.map +1 -1
  106. package/dist/string.d.ts +0 -2
  107. package/dist/string.d.ts.map +1 -1
  108. package/dist/string.js +1 -2
  109. package/dist/time.d.ts +0 -2
  110. package/dist/time.d.ts.map +1 -1
  111. package/dist/time.js +1 -2
  112. package/dist/types/filtered-key-path.d.ts +1 -2
  113. package/dist/types/filtered-key-path.d.ts.map +1 -1
  114. package/dist/types/index.d.ts +0 -10
  115. package/dist/types/index.d.ts.map +1 -1
  116. package/dist/types/vue.d.ts +0 -2
  117. package/dist/types/vue.d.ts.map +1 -1
  118. package/dist/url.d.ts +0 -2
  119. package/dist/url.d.ts.map +1 -1
  120. package/dist/url.js +1 -2
  121. package/dist/vue.d.ts +0 -2
  122. package/dist/vue.d.ts.map +1 -1
  123. package/dist/vue.js +1 -2
  124. package/dist/web.d.ts +0 -2
  125. package/dist/web.d.ts.map +1 -1
  126. package/dist/web.js +1 -2
  127. package/package.json +78 -45
  128. package/src/file.ts +37 -0
  129. package/src/logger/_internals/formatter.ts +80 -0
  130. package/src/logger/_internals/levels.ts +60 -0
  131. package/src/logger/_internals/logger.ts +224 -0
  132. package/src/logger/_internals/types.ts +12 -0
  133. package/src/logger/index.ts +34 -0
  134. package/src/logger/node/_internals/file-writer.ts +298 -0
  135. package/src/logger/node/_internals/formatter.ts +33 -0
  136. package/src/logger/node/index.ts +175 -0
  137. package/src/logger/node/types.ts +58 -0
  138. package/src/logger/types.ts +59 -0
  139. package/src/storages/lru/keyed-store.ts +4 -0
  140. package/src/types/index.ts +0 -10
  141. package/dist/classes/ssh-client.d.ts +0 -39
  142. package/dist/classes/ssh-client.d.ts.map +0 -1
  143. package/dist/classes/ssh-client.js +0 -130
  144. package/dist/classes/ssh-client.js.map +0 -1
  145. package/dist/consola.d.ts +0 -24
  146. package/dist/consola.d.ts.map +0 -1
  147. package/dist/consola.js +0 -29
  148. package/dist/consola.js.map +0 -1
  149. package/dist/object.d.ts +0 -44
  150. package/dist/object.d.ts.map +0 -1
  151. package/dist/object.js +0 -59
  152. package/dist/object.js.map +0 -1
  153. package/dist/pino.d.ts +0 -25
  154. package/dist/pino.d.ts.map +0 -1
  155. package/dist/pino.js +0 -34
  156. package/dist/pino.js.map +0 -1
  157. package/src/classes/ssh-client.ts +0 -175
  158. package/src/consola.ts +0 -25
  159. package/src/object.ts +0 -78
  160. package/src/pino.ts +0 -33
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-writer.js","names":[],"sources":["../../../../src/logger/node/_internals/file-writer.ts"],"sourcesContent":["import { Buffer } from 'node:buffer';\nimport { createWriteStream } from 'node:fs';\nimport { mkdir } from 'node:fs/promises';\nimport {\n basename,\n dirname,\n} from 'node:path';\nimport type { Writable } from 'node:stream';\nimport { fileURLToPath } from 'node:url';\n\nimport { Path } from '../../../classes/path';\nimport type { LoggerDiagnostic } from '../../types';\nimport type {\n LoggerFileOptions,\n NodeLoggerStats,\n} from '../types';\n\ninterface LoggerFileWriter {\n close: () => Promise<void>;\n getStats: () => NodeLoggerStats;\n write: (text: string) => Promise<void>;\n}\n\n// Constants/Variables\nconst defaultMaxPendingBytes = 8 * 1024 * 1024;\n\n// Functions\n\n/** A bounded admission layer over the stream's own ordered write buffer; not a second FIFO. */\nexport async function createFileWriter(\n options: LoggerFileOptions,\n report: (event: LoggerDiagnostic) => void,\n): Promise<LoggerFileWriter> {\n const {\n maxPendingBytes,\n path,\n rotate,\n } = validateFileOptions(options);\n\n const createRotatingStream = rotate ? (await import('rotating-file-stream')).createStream : undefined;\n await mkdir(dirname(path), { recursive: true });\n const stream: Writable = rotate && createRotatingStream\n ? createRotatingStream(\n basename(path),\n {\n compress: rotate.compress === false ? false : 'gzip',\n ...rotate.interval === undefined ? {} : { interval: rotate.interval === 'hourly' ? '1h' : '1d' },\n intervalBoundary: true,\n intervalUTC: false,\n maxFiles: rotate.keepFiles ?? 30,\n ...rotate.maxTotalSize === undefined ? {} : { maxSize: rotate.maxTotalSize },\n path: dirname(path),\n ...rotate.maxSize === undefined ? {} : { size: rotate.maxSize },\n },\n )\n : createWriteStream(path, { flags: 'a' });\n\n let pendingBytes = 0;\n let droppedCount = 0;\n let writeErrorCount = 0;\n let failed = false;\n let closing = false;\n let closed = false;\n let closePromise: Promise<void> | undefined;\n let initializing = true;\n const unfinished = new Set<() => void>();\n let rejectInitialization: ((error: unknown) => void) | undefined;\n\n const settleAll = () => {\n for (const settle of unfinished) settle();\n };\n\n const fail = (error: unknown) => {\n rejectInitialization?.(error);\n if (!failed) {\n failed = true;\n if (!initializing) {\n writeErrorCount++;\n report({\n error,\n message: 'File output failed and has been disabled.',\n type: 'file',\n });\n }\n }\n\n settleAll();\n if (!stream.destroyed) stream.destroy();\n };\n\n stream.on('error', fail);\n stream.on(\n 'warning',\n (error: unknown) => {\n writeErrorCount++;\n report({\n error,\n message: 'File rotation cleanup failed.',\n type: 'file',\n });\n },\n );\n\n stream.on(\n 'close',\n () => {\n closed = true;\n if (!closing && !failed) fail(new Error('File stream closed unexpectedly.'));\n settleAll();\n },\n );\n\n // A write callback also waits for RFS's asynchronous initialization and initial rotation.\n try {\n await new Promise<void>((resolveReady, rejectReady) => {\n rejectInitialization = rejectReady;\n stream.write(\n Buffer.alloc(0),\n (error) => {\n if (error) rejectReady(error);\n else resolveReady();\n },\n );\n });\n\n if (failed || closed) throw new Error('File output failed during initialization.');\n } catch (error) {\n if (!stream.destroyed) stream.destroy();\n if (!closed) {\n await new Promise<void>((resolveClosed) => {\n stream.once('close', resolveClosed);\n });\n }\n\n throw error;\n } finally {\n rejectInitialization = undefined;\n initializing = false;\n }\n\n return {\n close() {\n if (closePromise) return closePromise;\n closing = true;\n closePromise = new Promise<void>((resolveClosed) => {\n if (closed) {\n resolveClosed();\n return;\n }\n\n stream.once('close', resolveClosed);\n try {\n if (!stream.destroyed) stream.end();\n } catch (error) {\n fail(error);\n }\n });\n\n return closePromise;\n },\n getStats: () => ({\n droppedCount,\n pendingBytes,\n writeErrorCount,\n }),\n write(text) {\n if (closing || closed || failed) {\n report({\n message: 'File output is closed or unavailable.',\n type: 'closed',\n });\n\n return Promise.resolve();\n }\n\n const bytes = Buffer.byteLength(text);\n if (bytes > maxPendingBytes - pendingBytes) {\n droppedCount++;\n report({\n droppedCount,\n message: 'File output queue is full; the newest record was discarded.',\n type: 'overflow',\n });\n\n return Promise.resolve();\n }\n\n pendingBytes += bytes;\n return new Promise<void>((resolveWritten) => {\n let settled = false;\n const settle = () => {\n if (settled) return;\n settled = true;\n pendingBytes -= bytes;\n unfinished.delete(settle);\n resolveWritten();\n };\n\n unfinished.add(settle);\n try {\n stream.write(\n text,\n (error) => {\n if (error) fail(error);\n settle();\n },\n );\n } catch (error) {\n fail(error);\n }\n });\n },\n };\n}\n\n/** Validate before mkdir, stream creation, or other filesystem side effects. */\nfunction validateFileOptions(options: LoggerFileOptions) {\n if (\n !options\n || typeof options !== 'object'\n || !(\n typeof options.path === 'string'\n || options.path instanceof Path\n || options.path instanceof URL\n || Buffer.isBuffer(options.path)\n )\n ) {\n throw new TypeError('file.path must be a string, Buffer, file URL, or Path');\n }\n\n const path = options.path instanceof URL\n ? fileURLToPath(options.path)\n : options.path.toString();\n\n if (Buffer.isBuffer(options.path) && !Buffer.from(path).equals(options.path)) {\n throw new TypeError('file.path Buffer must contain valid UTF-8');\n }\n\n if (!path.trim() || path.includes('\\0')) {\n throw new TypeError('file.path must be a nonempty path without null bytes');\n }\n\n const maxPendingBytes = options.maxPendingBytes ?? defaultMaxPendingBytes;\n if (!Number.isSafeInteger(maxPendingBytes) || maxPendingBytes <= 0) {\n throw new RangeError('file.maxPendingBytes must be a positive safe integer');\n }\n\n const rotate = options.rotate;\n if (rotate !== undefined && rotate !== false) {\n if (!rotate || typeof rotate !== 'object') {\n throw new TypeError('file.rotate must be false or an options object');\n }\n\n if (rotate.interval !== undefined && rotate.interval !== 'hourly' && rotate.interval !== 'daily') {\n throw new TypeError('file.rotate.interval must be hourly or daily');\n }\n\n if (rotate.interval === undefined && rotate.maxSize === undefined) {\n throw new TypeError('file.rotate requires interval or maxSize');\n }\n\n const keepFiles = rotate.keepFiles ?? 30;\n if (!Number.isSafeInteger(keepFiles) || keepFiles <= 0) {\n throw new RangeError('file.rotate.keepFiles must be a positive safe integer');\n }\n\n if (rotate.compress !== undefined && typeof rotate.compress !== 'boolean') {\n throw new TypeError('file.rotate.compress must be a boolean');\n }\n\n validateSize(rotate.maxSize, 'file.rotate.maxSize');\n validateSize(rotate.maxTotalSize, 'file.rotate.maxTotalSize');\n }\n\n return {\n maxPendingBytes,\n path: Path.resolve(path).value,\n rotate,\n };\n}\n\nfunction validateSize(value: string | undefined, name: string) {\n if (value === undefined) return;\n if (typeof value !== 'string' || !/^[1-9]\\d*[BKMG]$/.test(value)) {\n throw new TypeError(`${name} must be a positive integer followed by B, K, M, or G`);\n }\n\n const multiplier = {\n B: 1,\n G: 1024 ** 3,\n K: 1024,\n M: 1024 ** 2,\n }[value.at(-1) as 'B' | 'G' | 'K' | 'M'];\n\n if (!Number.isSafeInteger(Number(value.slice(0, -1)) * multiplier)) {\n throw new RangeError(`${name} exceeds the supported size range`);\n }\n}\n"],"mappings":"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"}
@@ -0,0 +1,4 @@
1
+ import { LoggerRecord } from "../../_internals/types.js";
2
+ /** Preserve user ANSI for console output without invoking custom inspect callbacks/getters. */
3
+ export declare function formatNodeLoggerRecord(record: LoggerRecord, colors?: boolean): string;
4
+ //# sourceMappingURL=formatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatter.d.ts","names":[],"sources":["../../../../src/logger/node/_internals/formatter.ts"],"mappings":";;wBAQgB,uBAAuB,QAAQ,cAAc"}
@@ -0,0 +1,21 @@
1
+ import { formatLoggerParts } from "../../_internals/formatter.js";
2
+ import { inspect } from "node:util";
3
+ // src/logger/node/_internals/formatter.ts
4
+ /** Preserve user ANSI for console output without invoking custom inspect callbacks/getters. */
5
+ function formatNodeLoggerRecord(record, colors = false) {
6
+ const message = record.args.map((arg) => typeof arg === "string" ? arg : inspect(arg, {
7
+ colors: false,
8
+ customInspect: false,
9
+ depth: 6,
10
+ getters: false,
11
+ maxArrayLength: 100,
12
+ maxStringLength: 1e4
13
+ })).join(" ");
14
+ return formatLoggerParts({
15
+ ...record,
16
+ args: record.args.length ? [message] : []
17
+ }, colors).join(" ");
18
+ }
19
+ export { formatNodeLoggerRecord };
20
+
21
+ //# sourceMappingURL=formatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatter.js","names":[],"sources":["../../../../src/logger/node/_internals/formatter.ts"],"sourcesContent":["import { inspect } from 'node:util';\n\nimport { formatLoggerParts } from '../../_internals/formatter';\nimport type { LoggerRecord } from '../../_internals/types';\n\n// Functions\n\n/** Preserve user ANSI for console output without invoking custom inspect callbacks/getters. */\nexport function formatNodeLoggerRecord(record: LoggerRecord, colors = false) {\n const message = record.args.map(\n (arg) => typeof arg === 'string'\n ? arg\n : inspect(\n arg,\n {\n colors: false,\n customInspect: false,\n depth: 6,\n getters: false,\n maxArrayLength: 100,\n maxStringLength: 10_000,\n },\n ),\n ).join(' ');\n\n return formatLoggerParts(\n {\n ...record,\n args: record.args.length ? [message] : [],\n },\n colors,\n ).join(' ');\n}\n"],"mappings":";;;;AAQA,SAAgB,uBAAuB,QAAsB,SAAS,OAAO;CACzE,MAAM,UAAU,OAAO,KAAK,KACvB,QAAQ,OAAO,QAAQ,WAClB,MACA,QACE,KACA;EACI,QAAQ;EACR,eAAe;EACf,OAAO;EACP,SAAS;EACT,gBAAgB;EAChB,iBAAiB;CACrB,CACJ,CACR,CAAC,CAAC,KAAK,GAAG;CAEV,OAAO,kBACH;EACI,GAAG;EACH,MAAM,OAAO,KAAK,SAAS,CAAC,OAAO,IAAI,CAAC;CAC5C,GACA,MACJ,CAAC,CAAC,KAAK,GAAG;AACd"}
@@ -0,0 +1,10 @@
1
+ import { NodeLogger, NodeLoggerOptions } from "./types.js";
2
+ /**
3
+ * Creates a Node.js/Bun logger with optional bounded, append-only file output and rotation.
4
+ *
5
+ * Log calls never throw or reject. Awaiting them waits for processing, not proof of successful
6
+ * persistence: overload drops the newest file record and failures are reported safely. Factory
7
+ * validation/open failures reject. Call close explicitly; no process signal handlers are installed.
8
+ */
9
+ export declare function createNodeLogger(options?: NodeLoggerOptions): Promise<NodeLogger>;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/logger/node/index.ts"],"mappings":";;;;;;;;wBAqCsB,iBAAiB,UAAS,oBAAyB,QAAQ"}
@@ -0,0 +1,122 @@
1
+ import { getLoggerStreamName } from "../_internals/levels.js";
2
+ import { supportsLoggerColor } from "../_internals/formatter.js";
3
+ import { createDiagnosticReporter, createLoggerCore } from "../_internals/logger.js";
4
+ import { createFileWriter } from "./_internals/file-writer.js";
5
+ import { formatNodeLoggerRecord } from "./_internals/formatter.js";
6
+ import { writeSync } from "node:fs";
7
+ import { stripVTControlCharacters } from "node:util";
8
+ // src/logger/node/index.ts
9
+ const consoleStreams = /* @__PURE__ */ new WeakMap();
10
+ /**
11
+ * Creates a Node.js/Bun logger with optional bounded, append-only file output and rotation.
12
+ *
13
+ * Log calls never throw or reject. Awaiting them waits for processing, not proof of successful
14
+ * persistence: overload drops the newest file record and failures are reported safely. Factory
15
+ * validation/open failures reject. Call close explicitly; no process signal handlers are installed.
16
+ */
17
+ async function createNodeLogger(options = {}) {
18
+ const report = createDiagnosticReporter(options.onError, (message) => writeSync(2, message));
19
+ let writer;
20
+ let closed = false;
21
+ let closePromise;
22
+ const consoleOwner = {};
23
+ const consoleTargets = /* @__PURE__ */ new Set();
24
+ const consoleWrites = /* @__PURE__ */ new Set();
25
+ const logger = createLoggerCore(options, {
26
+ report,
27
+ write(record) {
28
+ if (closed) {
29
+ report({
30
+ message: "Logger is closed.",
31
+ type: "closed"
32
+ });
33
+ return;
34
+ }
35
+ if (!record.console && !writer) return;
36
+ const target = process[getLoggerStreamName(record.type)];
37
+ const text = formatNodeLoggerRecord(record, record.console && supportsLoggerColor(target));
38
+ if (record.console) {
39
+ const line = `${text}\n`;
40
+ consoleTargets.add(target);
41
+ const completion = writeConsole(target, line, report, consoleOwner);
42
+ consoleWrites.add(completion);
43
+ completion.then(() => consoleWrites.delete(completion));
44
+ const fileCompletion = writer?.write(`${stripVTControlCharacters(text)}\n`);
45
+ return fileCompletion ? Promise.all([completion, fileCompletion]).then(() => {}) : completion;
46
+ }
47
+ return writer?.write(`${stripVTControlCharacters(text)}\n`);
48
+ }
49
+ });
50
+ if (options.file !== void 0 && options.file !== false) writer = await createFileWriter(options.file, report);
51
+ return Object.assign(logger, {
52
+ close() {
53
+ if (closePromise) return closePromise;
54
+ closed = true;
55
+ closePromise = (async () => {
56
+ await Promise.all([writer?.close(), ...consoleWrites]);
57
+ for (const target of consoleTargets) {
58
+ const state = consoleStreams.get(target);
59
+ if (!state) continue;
60
+ state.owners.delete(consoleOwner);
61
+ if (!state.owners.size) {
62
+ target.off("error", state.onError);
63
+ target.off("close", state.onClose);
64
+ consoleStreams.delete(target);
65
+ }
66
+ }
67
+ consoleTargets.clear();
68
+ })();
69
+ return closePromise;
70
+ },
71
+ getStats: () => writer?.getStats() ?? {
72
+ droppedCount: 0,
73
+ pendingBytes: 0,
74
+ writeErrorCount: 0
75
+ }
76
+ });
77
+ }
78
+ /** One error listener per shared output stream; retained until its last owning logger calls close(). */
79
+ function writeConsole(target, text, report, owner) {
80
+ let state = consoleStreams.get(target);
81
+ if (!state) {
82
+ const pending = /* @__PURE__ */ new Set();
83
+ const onError = (error) => {
84
+ for (const settle of pending) settle(error);
85
+ };
86
+ const onClose = () => onError(/* @__PURE__ */ new Error("Console stream closed."));
87
+ state = {
88
+ onClose,
89
+ onError,
90
+ owners: /* @__PURE__ */ new Set(),
91
+ pending
92
+ };
93
+ consoleStreams.set(target, state);
94
+ target.on("error", onError);
95
+ target.on("close", onClose);
96
+ }
97
+ state.owners.add(owner);
98
+ const current = state;
99
+ return new Promise((resolveWritten) => {
100
+ let settled = false;
101
+ const settle = (error) => {
102
+ if (settled) return;
103
+ settled = true;
104
+ current.pending.delete(settle);
105
+ if (error) report({
106
+ error,
107
+ message: "Console output failed.",
108
+ type: "console"
109
+ });
110
+ resolveWritten();
111
+ };
112
+ current.pending.add(settle);
113
+ try {
114
+ target.write(text, settle);
115
+ } catch (error) {
116
+ settle(error instanceof Error ? error : /* @__PURE__ */ new Error("Console output failed."));
117
+ }
118
+ });
119
+ }
120
+ export { createNodeLogger };
121
+
122
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/logger/node/index.ts"],"sourcesContent":["import { writeSync } from 'node:fs';\nimport { stripVTControlCharacters } from 'node:util';\n\nimport { supportsLoggerColor } from '../_internals/formatter';\nimport { getLoggerStreamName } from '../_internals/levels';\nimport {\n createDiagnosticReporter,\n createLoggerCore,\n} from '../_internals/logger';\nimport type { LoggerDiagnostic } from '../types';\n\nimport { createFileWriter } from './_internals/file-writer';\nimport { formatNodeLoggerRecord } from './_internals/formatter';\nimport type {\n NodeLogger,\n NodeLoggerOptions,\n} from './types';\n\ninterface ConsoleStreamState {\n onClose: () => void;\n onError: (error: Error) => void;\n owners: Set<object>;\n pending: Set<(error?: Error | null) => void>;\n}\n\n// Constants/Variables\nconst consoleStreams = new WeakMap<NodeJS.WriteStream, ConsoleStreamState>();\n\n// Functions\n\n/**\n * Creates a Node.js/Bun logger with optional bounded, append-only file output and rotation.\n *\n * Log calls never throw or reject. Awaiting them waits for processing, not proof of successful\n * persistence: overload drops the newest file record and failures are reported safely. Factory\n * validation/open failures reject. Call close explicitly; no process signal handlers are installed.\n */\nexport async function createNodeLogger(options: NodeLoggerOptions = {}): Promise<NodeLogger> {\n const report = createDiagnosticReporter(options.onError, (message) => writeSync(2, message));\n let writer: Awaited<ReturnType<typeof createFileWriter>> | undefined;\n let closed = false;\n let closePromise: Promise<void> | undefined;\n const consoleOwner = {};\n const consoleTargets = new Set<NodeJS.WriteStream>();\n const consoleWrites = new Set<Promise<void>>();\n const logger = createLoggerCore(\n options,\n {\n report,\n write(record) {\n if (closed) {\n report({\n message: 'Logger is closed.',\n type: 'closed',\n });\n\n return;\n }\n\n if (!record.console && !writer) return;\n const target = process[getLoggerStreamName(record.type)];\n\n const text = formatNodeLoggerRecord(record, record.console && supportsLoggerColor(target));\n if (record.console) {\n const line = `${text}\\n`;\n consoleTargets.add(target);\n const completion = writeConsole(target, line, report, consoleOwner);\n consoleWrites.add(completion);\n void completion.then(() => consoleWrites.delete(completion));\n const fileCompletion = writer?.write(`${stripVTControlCharacters(text)}\\n`);\n return fileCompletion\n ? Promise.all([\n completion,\n fileCompletion,\n ]).then(() => {})\n : completion;\n }\n\n return writer?.write(`${stripVTControlCharacters(text)}\\n`);\n },\n },\n );\n\n if (options.file !== undefined && options.file !== false) writer = await createFileWriter(options.file, report);\n\n return Object.assign(\n logger,\n {\n close() {\n if (closePromise) return closePromise;\n closed = true;\n closePromise = (async () => {\n await Promise.all([\n writer?.close(),\n ...consoleWrites,\n ]);\n\n for (const target of consoleTargets) {\n const state = consoleStreams.get(target);\n if (!state) continue;\n state.owners.delete(consoleOwner);\n if (!state.owners.size) {\n target.off('error', state.onError);\n target.off('close', state.onClose);\n consoleStreams.delete(target);\n }\n }\n\n consoleTargets.clear();\n })();\n return closePromise;\n },\n getStats: () => writer?.getStats() ?? {\n droppedCount: 0,\n pendingBytes: 0,\n writeErrorCount: 0,\n },\n },\n );\n}\n\n/** One error listener per shared output stream; retained until its last owning logger calls close(). */\nfunction writeConsole(\n target: NodeJS.WriteStream,\n text: string,\n report: (event: LoggerDiagnostic) => void,\n owner: object,\n) {\n let state = consoleStreams.get(target);\n if (!state) {\n const pending = new Set<(error?: Error | null) => void>();\n const onError = (error: Error) => {\n for (const settle of pending) settle(error);\n };\n\n const onClose = () => onError(new Error('Console stream closed.'));\n state = {\n onClose,\n onError,\n owners: new Set(),\n pending,\n };\n\n consoleStreams.set(target, state);\n target.on('error', onError);\n target.on('close', onClose);\n }\n\n state.owners.add(owner);\n const current = state;\n return new Promise<void>((resolveWritten) => {\n let settled = false;\n const settle = (error?: Error | null) => {\n if (settled) return;\n settled = true;\n current.pending.delete(settle);\n if (error) {\n report({\n error,\n message: 'Console output failed.',\n type: 'console',\n });\n }\n\n resolveWritten();\n };\n\n current.pending.add(settle);\n try {\n target.write(text, settle);\n } catch (error) {\n settle(error instanceof Error ? error : new Error('Console output failed.'));\n }\n });\n}\n"],"mappings":"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"}
@@ -0,0 +1,43 @@
1
+ import { PathLike } from "../../classes/path.js";
2
+ import { Logger, LoggerOptions } from "../types.js";
3
+ /** Specify interval and/or maxSize. Size limits use positive integers with B, K, M, or G (binary units). */
4
+ export type LoggerRotationOptions = {
5
+ /** Gzip historical files. Defaults to true. */
6
+ compress?: boolean;
7
+ /** Number of historical files, excluding the active file. Defaults to 30. */
8
+ keepFiles?: number;
9
+ /** Maximum combined size of historical files. */
10
+ maxTotalSize?: string;
11
+ } & ({
12
+ /** Opt-in time rotation aligned to the system's local calendar boundary. */
13
+ interval: 'daily' | 'hourly';
14
+ maxSize?: string;
15
+ } | {
16
+ /** Opt-in time rotation aligned to the system's local calendar boundary. */
17
+ interval?: 'daily' | 'hourly';
18
+ maxSize: string;
19
+ });
20
+ export interface LoggerFileOptions {
21
+ /** Maximum unfinished payload bytes, including data already submitted to the stream. */
22
+ maxPendingBytes?: number;
23
+ /** Resolved once at creation. The file is opened in append mode. */
24
+ path: PathLike;
25
+ /** Omitted or false disables rotation. An object must specify interval or maxSize. */
26
+ rotate?: false | LoggerRotationOptions;
27
+ }
28
+ export interface NodeLogger extends Logger {
29
+ /** Stop accepting records, finish accepted file writes, then release the stream. Not fsync. */
30
+ close: () => Promise<void>;
31
+ /** A fresh snapshot. Dropped/failed records still resolve their logging promises. */
32
+ getStats: () => NodeLoggerStats;
33
+ }
34
+ export interface NodeLoggerOptions extends LoggerOptions {
35
+ /** Disabled by default. Each logger owns at most one fixed file destination. */
36
+ file?: false | LoggerFileOptions;
37
+ }
38
+ export interface NodeLoggerStats {
39
+ droppedCount: number;
40
+ pendingBytes: number;
41
+ writeErrorCount: number;
42
+ }
43
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/logger/node/types.ts"],"mappings":";;;YAOY;;EAER;;EAGA;;EAGA;;;EAIE;EACA;;;EAIA;EACA;;iBAIW;;EAEb;;EAGA,MAAM;;EAGN,iBAAiB;;iBAGJ,mBAAmB;;EAEhC,aAAa;;EAGb,gBAAgB;;iBAGH,0BAA0B;;EAEvC,eAAe;;iBAGF;EACb;EACA;EACA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,49 @@
1
+ /** Minimum severity to emit; `success` uses the same threshold as `info`. */
2
+ export type LoggerLevel = 'debug' | 'error' | 'fatal' | 'info' | 'silent' | 'trace' | 'warn';
3
+ /** A logging method, including the informational success presentation. */
4
+ export type LoggerMethod = 'success' | Exclude<LoggerLevel, 'silent'>;
5
+ /**
6
+ * A logger whose logging methods never throw or reject for recoverable failures.
7
+ *
8
+ * Awaiting a method waits for processing, not guaranteed successful delivery or fsync.
9
+ * Configuration errors may throw from the factory, configure(), or setLevel().
10
+ */
11
+ export interface Logger {
12
+ configure: (options: Pick<LoggerOptions, 'console' | 'icons' | 'prefix' | 'suffix' | 'timestamp'>) => void;
13
+ debug: (...args: unknown[]) => Promise<void>;
14
+ error: (...args: unknown[]) => Promise<void>;
15
+ fatal: (...args: unknown[]) => Promise<void>;
16
+ info: (...args: unknown[]) => Promise<void>;
17
+ /** Accepts success as an informational method; it is not a configurable threshold. */
18
+ isLevelEnabled: (level: LoggerLevel | LoggerMethod) => boolean;
19
+ /** Sets a severity threshold (not success); env restores environment-driven filtering. */
20
+ setLevel: (level: 'env' | LoggerLevel) => void;
21
+ success: (...args: unknown[]) => Promise<void>;
22
+ trace: (...args: unknown[]) => Promise<void>;
23
+ warn: (...args: unknown[]) => Promise<void>;
24
+ }
25
+ /** A recoverable logging failure, reported without throwing from log methods. */
26
+ export interface LoggerDiagnostic {
27
+ droppedCount?: number;
28
+ error?: unknown;
29
+ message: string;
30
+ /** Same-type notifications suppressed since the previous emitted diagnostic. */
31
+ suppressedCount?: number;
32
+ type: 'closed' | 'console' | 'file' | 'format' | 'invalid-level' | 'overflow';
33
+ }
34
+ /** Configuration shared by browser and server loggers. */
35
+ export interface LoggerOptions {
36
+ /** Enables console output. Defaults to `true`. */
37
+ console?: boolean;
38
+ /** Enables Unicode level icons. Defaults to `true`. */
39
+ icons?: boolean;
40
+ /** Overrides LOG_LEVEL; `env` restores the environment-driven threshold. */
41
+ level?: 'env' | LoggerLevel;
42
+ /** Best-effort, rate-limited notification; failures in this callback are contained. */
43
+ onError?: (event: LoggerDiagnostic) => void;
44
+ prefix?: string;
45
+ suffix?: string;
46
+ /** Enables the fixed local-time millisecond prefix. Defaults to `true`. */
47
+ timestamp?: boolean;
48
+ }
49
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../src/logger/types.ts"],"mappings":";YACY;;YAGA,2BAA2B,QAAQ;;;;;;;iBAQ9B;EACb,YAAY,SAAS,KAAK;EAC1B,WAAW,oBAAoB;EAC/B,WAAW,oBAAoB;EAC/B,WAAW,oBAAoB;EAC/B,UAAU,oBAAoB;;EAG9B,iBAAiB,OAAO,cAAc;;EAGtC,WAAW,eAAe;EAC1B,aAAa,oBAAoB;EACjC,WAAW,oBAAoB;EAC/B,UAAU,oBAAoB;;;iBAIjB;EACb;EACA;EACA;;EAGA;EACA;;;iBAIa;;EAEb;;EAGA;;EAGA,gBAAgB;;EAGhB,WAAW,OAAO;EAClB;EACA;;EAGA"}
@@ -0,0 +1 @@
1
+ export {};
package/dist/math.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Decimal } from "decimal.js";
2
- //#region src/math.d.ts
3
2
  type CalculableValue = Decimal.Value | {
4
3
  toString: () => string;
5
4
  };
@@ -45,5 +44,5 @@ export interface ToPercentageStringOptions {
45
44
  * ```
46
45
  */
47
46
  export declare function toPercentageString(molecular: CalculableValue, denominator: CalculableValue, options?: ToPercentageStringOptions): string;
48
- //#endregion
47
+ export {};
49
48
  //# sourceMappingURL=math.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"math.d.ts","names":[],"sources":["../src/math.ts"],"mappings":";;KAEK,kBAAkB,QAAQ;EAAU;;;;;iBAKxB;;;;;;EAMb;;;;;;EAOA;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2BY,mBACZ,WAAW,iBACX,aAAa,iBACb,UAAU"}
1
+ {"version":3,"file":"math.d.ts","names":[],"sources":["../src/math.ts"],"mappings":";KAEK,kBAAkB,QAAQ;EAAU;;;;;iBAKxB;;;;;;EAMb;;;;;;EAOA;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2BY,mBACZ,WAAW,iBACX,aAAa,iBACb,UAAU"}
package/dist/math.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Decimal } from "decimal.js";
2
- //#region src/math.ts
2
+ // src/math.ts
3
3
  /**
4
4
  * Converts a numerator and denominator into a formatted percentage.
5
5
  *
@@ -31,7 +31,6 @@ function toPercentageString(molecular, denominator, options) {
31
31
  const result = calculationResult.isNaN() || !calculationResult.isFinite() ? "0.00" : calculationResult.times(100).toFixed(options?.decimalPlaces ?? 2);
32
32
  return options?.withSymbol ?? true ? `${result}%` : result;
33
33
  }
34
- //#endregion
35
34
  export { toPercentageString };
36
35
 
37
36
  //# sourceMappingURL=math.js.map
package/dist/number.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { millify } from "millify";
2
- //#region src/number.d.ts
3
2
  /**
4
3
  * Converts a large number into a compact, human-readable string using `millify`.
5
4
  *
@@ -21,5 +20,4 @@ import { millify } from "millify";
21
20
  * ```
22
21
  */
23
22
  export declare function toCompactNumberString(value: number, options?: Parameters<typeof millify>[1]): string;
24
- //#endregion
25
23
  //# sourceMappingURL=number.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"number.d.ts","names":[],"sources":["../src/number.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;wBAsBgB,sBAAsB,eAAe,UAAU,kBAAkB"}
1
+ {"version":3,"file":"number.d.ts","names":[],"sources":["../src/number.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;wBAsBgB,sBAAsB,eAAe,UAAU,kBAAkB"}
package/dist/number.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { millify } from "millify";
2
- //#region src/number.ts
2
+ // src/number.ts
3
3
  /**
4
4
  * Converts a large number into a compact, human-readable string using `millify`.
5
5
  *
@@ -27,7 +27,6 @@ function toCompactNumberString(value, options) {
27
27
  ...options
28
28
  });
29
29
  }
30
- //#endregion
31
30
  export { toCompactNumberString };
32
31
 
33
32
  //# sourceMappingURL=number.js.map
package/dist/random.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/random.d.ts
2
1
  /**
3
2
  * Calls a generator once with a length sampled from two nested random ranges.
4
3
  *
@@ -23,5 +22,4 @@
23
22
  * @throws Error if `minMin` exceeds `minMax` or `maxMin` exceeds `maxMax`.
24
23
  */
25
24
  export declare function generateWithNestedRandomLength<T = string>(generator: (length: number) => T, minMin: number, minMax: number, maxMin: number, maxMax: number): T;
26
- //#endregion
27
25
  //# sourceMappingURL=random.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"random.d.ts","names":[],"sources":["../src/random.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;wBAuBgB,+BAA+B,YAC3C,YAAY,mBAAmB,GAC/B,gBACA,gBACA,gBACA,iBAAc"}
1
+ {"version":3,"file":"random.d.ts","names":[],"sources":["../src/random.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;wBAuBgB,+BAA+B,YAC3C,YAAY,mBAAmB,GAC/B,gBACA,gBACA,gBACA,iBAAc"}
package/dist/random.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/random.ts
1
+ // src/random.ts
2
2
  /**
3
3
  * Calls a generator once with a length sampled from two nested random ranges.
4
4
  *
@@ -29,7 +29,6 @@ function generateWithNestedRandomLength(generator, minMin, minMax, maxMin, maxMa
29
29
  const innerMin = random(minMin, minMax);
30
30
  return generator(random(Math.max(innerMin, maxMin), maxMax));
31
31
  }
32
- //#endregion
33
32
  export { generateWithNestedRandomLength };
34
33
 
35
34
  //# sourceMappingURL=random.js.map
@@ -1,4 +1,3 @@
1
- //#region src/redis/script-runner.d.ts
2
1
  /**
3
2
  * An asynchronous Lua script runner with caller-declared results.
4
3
  *
@@ -53,5 +52,4 @@ export interface RedisLikeScriptClient {
53
52
  * @throws RangeError if `maxAttempts` is not a positive safe integer.
54
53
  */
55
54
  export declare function createRedisScriptRunner<T = unknown>(client: RedisLikeScriptClient, source: string, maxAttempts?: number): RedisScriptRunner<T>;
56
- //#endregion
57
55
  //# sourceMappingURL=script-runner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"script-runner.d.ts","names":[],"sources":["../../src/redis/script-runner.ts"],"mappings":";;;;;;;;;;;;;;;YAgBY,kBAAkB,gBAAgB,yBAAyB,uCAAuC,QAC1G;;;;;;;;;iBAWa;;;;;;;EAOb,OAAO,iBAAiB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;wBAwB/B,wBAAwB,aACpC,QAAQ,uBACR,gBACA,uBACD,kBAAkB"}
1
+ {"version":3,"file":"script-runner.d.ts","names":[],"sources":["../../src/redis/script-runner.ts"],"mappings":";;;;;;;;;;;;;;YAgBY,kBAAkB,gBAAgB,yBAAyB,uCAAuC,QAC1G;;;;;;;;;iBAWa;;;;;;;EAOb,OAAO,iBAAiB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;wBAwB/B,wBAAwB,aACpC,QAAQ,uBACR,gBACA,uBACD,kBAAkB"}
@@ -1,5 +1,5 @@
1
1
  import { createHash } from "node:crypto";
2
- //#region src/redis/script-runner.ts
2
+ // src/redis/script-runner.ts
3
3
  /**
4
4
  * Creates a Lua script runner that reloads missing cached scripts before retrying execution.
5
5
  *
@@ -40,7 +40,6 @@ function createRedisScriptRunner(client, source, maxAttempts = 3) {
40
40
  }
41
41
  };
42
42
  }
43
- //#endregion
44
43
  export { createRedisScriptRunner };
45
44
 
46
45
  //# sourceMappingURL=script-runner.js.map
@@ -1,5 +1,4 @@
1
1
  import { LRUCache } from "lru-cache";
2
- //#region src/storages/lru/keyed-store.d.ts
3
2
  /**
4
3
  * Creates a keyed cache factory sharing a caller-owned LRU cache.
5
4
  *
@@ -7,6 +6,7 @@ import { LRUCache } from "lru-cache";
7
6
  * The key resolver is called synchronously once per operation, and its exceptions propagate.
8
7
  * Reads return the cached value without copying it, or `null` for missing or nullish values.
9
8
  * `getItemTtl` exposes the underlying remaining TTL in milliseconds; `setItem` returns the underlying cache.
9
+ * `setItemWithTtl` accepts its TTL in milliseconds before the value and key arguments and returns the cache.
10
10
  * The facade does not dispose the supplied cache, and LRU defaults remain those of the supplied instance.
11
11
  *
12
12
  * @typeParam D - The stored value type used by reads and writes.
@@ -42,6 +42,6 @@ export declare function createLruKeyedStore<D = unknown>(lruInstance: LRUCache<a
42
42
  */
43
43
  resolveKey: (...args: P) => string;
44
44
  setItem: (value: D, ...args: P) => LRUCache<any, any, any>;
45
+ setItemWithTtl(ttlMilliseconds: number, value: D, ...args: P): LRUCache<any, any, any>;
45
46
  }>;
46
- //#endregion
47
47
  //# sourceMappingURL=keyed-store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyed-store.d.ts","names":[],"sources":["../../../src/storages/lru/keyed-store.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6BgB,oBAAoB,aAAa,aAAa,2BAClD,iBAAiB,WAAW,MAAM,iBAAY;;;;;;EAMjC,WAAA,MAAA,IAAC,YAAA;EAII,gBAAA,MAAA;EACH,aAAA,MAAA;EACG,gBAAA,MAAA;;;;EAIA,gBAAA,MAAA;EACL,UAAA,OAAA,MAAC,MAAW,MAAC"}
1
+ {"version":3,"file":"keyed-store.d.ts","names":[],"sources":["../../../src/storages/lru/keyed-store.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8BgB,oBAAoB,aAAa,aAAa,2BAClD,iBAAiB,WAAW,MAAM,iBAAY;;;;;;EAMjC,WAAA,MAAA,IAAC,YAAA;EAII,gBAAA,MAAA;EACH,aAAA,MAAA;EACG,gBAAA,MAAA;;;;EAIA,gBAAA,MAAA;EACL,UAAA,OAAA,MAAC,MAAW,MAAC;EACE,eAAA,yBAAM,OAAS,MAAC,MAAW,IAAC"}
@@ -1,4 +1,4 @@
1
- //#region src/storages/lru/keyed-store.ts
1
+ // src/storages/lru/keyed-store.ts
2
2
  /**
3
3
  * Creates a keyed cache factory sharing a caller-owned LRU cache.
4
4
  *
@@ -6,6 +6,7 @@
6
6
  * The key resolver is called synchronously once per operation, and its exceptions propagate.
7
7
  * Reads return the cached value without copying it, or `null` for missing or nullish values.
8
8
  * `getItemTtl` exposes the underlying remaining TTL in milliseconds; `setItem` returns the underlying cache.
9
+ * `setItemWithTtl` accepts its TTL in milliseconds before the value and key arguments and returns the cache.
9
10
  * The facade does not dispose the supplied cache, and LRU defaults remain those of the supplied instance.
10
11
  *
11
12
  * @typeParam D - The stored value type used by reads and writes.
@@ -43,10 +44,12 @@ function createLruKeyedStore(lruInstance) {
43
44
  * Resolves the full cache key from the given arguments.
44
45
  */
45
46
  resolveKey: (...args) => keyFn(...args),
46
- setItem: (value, ...args) => lruInstance.set(keyFn(...args), value)
47
+ setItem: (value, ...args) => lruInstance.set(keyFn(...args), value),
48
+ setItemWithTtl(ttlMilliseconds, value, ...args) {
49
+ return lruInstance.set(keyFn(...args), value, { ttl: ttlMilliseconds });
50
+ }
47
51
  });
48
52
  }
49
- //#endregion
50
53
  export { createLruKeyedStore };
51
54
 
52
55
  //# sourceMappingURL=keyed-store.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyed-store.js","names":[],"sources":["../../../src/storages/lru/keyed-store.ts"],"sourcesContent":["import type { LRUCache } from 'lru-cache';\n\n/**\n * Creates a keyed cache factory sharing a caller-owned LRU cache.\n *\n * @remarks\n * The key resolver is called synchronously once per operation, and its exceptions propagate.\n * Reads return the cached value without copying it, or `null` for missing or nullish values.\n * `getItemTtl` exposes the underlying remaining TTL in milliseconds; `setItem` returns the underlying cache.\n * The facade does not dispose the supplied cache, and LRU defaults remain those of the supplied instance.\n *\n * @typeParam D - The stored value type used by reads and writes.\n *\n * @param lruInstance - The shared LRU cache instance.\n *\n * @returns A factory accepting a key resolver and returning a new frozen keyed facade sharing the cache.\n *\n * @example\n *\n * ```ts\n * import { createLruKeyedStore } from '@kikiutils/shared/storages/lru/keyed-store';\n * import { LRUCache } from 'lru-cache';\n *\n * const cache = new LRUCache<string, { name: string }>({ max: 100 });\n * const keyedStore = createLruKeyedStore<{ name: string }>(cache)((userId: string) => `user:${userId}`);\n * keyedStore.setItem({ name: 'Alice' }, 'user-123');\n * console.log(keyedStore.getItem('user-123')); // => { name: 'Alice' }\n * ```\n */\nexport function createLruKeyedStore<D = unknown>(lruInstance: LRUCache<any, any, any>) {\n return <P extends any[]>(keyFn: (...args: P) => string) => Object.freeze({\n /**\n * Returns the cached value and applies the underlying cache's read-recency policy.\n *\n * @returns The cached value without copying it, or `null` when absent or nullish.\n */\n getItem(...args: P) {\n const rawValue = lruInstance.get(keyFn(...args));\n return rawValue as D ?? null;\n },\n getItemTtl: (...args: P) => lruInstance.getRemainingTTL(keyFn(...args)),\n hasItem: (...args: P) => lruInstance.has(keyFn(...args)),\n removeItem: (...args: P) => lruInstance.delete(keyFn(...args)),\n /**\n * Resolves the full cache key from the given arguments.\n */\n resolveKey: (...args: P) => keyFn(...args),\n setItem: (value: D, ...args: P) => lruInstance.set(keyFn(...args), value),\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAgB,oBAAiC,aAAsC;CACnF,QAAyB,UAAkC,OAAO,OAAO;;;;;;EAMrE,QAAQ,GAAG,MAAS;GAEhB,OADiB,YAAY,IAAI,MAAM,GAAG,IAAI,CAChC,KAAU;EAC5B;EACA,aAAa,GAAG,SAAY,YAAY,gBAAgB,MAAM,GAAG,IAAI,CAAC;EACtE,UAAU,GAAG,SAAY,YAAY,IAAI,MAAM,GAAG,IAAI,CAAC;EACvD,aAAa,GAAG,SAAY,YAAY,OAAO,MAAM,GAAG,IAAI,CAAC;;;;EAI7D,aAAa,GAAG,SAAY,MAAM,GAAG,IAAI;EACzC,UAAU,OAAU,GAAG,SAAY,YAAY,IAAI,MAAM,GAAG,IAAI,GAAG,KAAK;CAC5E,CAAC;AACL"}
1
+ {"version":3,"file":"keyed-store.js","names":[],"sources":["../../../src/storages/lru/keyed-store.ts"],"sourcesContent":["import type { LRUCache } from 'lru-cache';\n\n/**\n * Creates a keyed cache factory sharing a caller-owned LRU cache.\n *\n * @remarks\n * The key resolver is called synchronously once per operation, and its exceptions propagate.\n * Reads return the cached value without copying it, or `null` for missing or nullish values.\n * `getItemTtl` exposes the underlying remaining TTL in milliseconds; `setItem` returns the underlying cache.\n * `setItemWithTtl` accepts its TTL in milliseconds before the value and key arguments and returns the cache.\n * The facade does not dispose the supplied cache, and LRU defaults remain those of the supplied instance.\n *\n * @typeParam D - The stored value type used by reads and writes.\n *\n * @param lruInstance - The shared LRU cache instance.\n *\n * @returns A factory accepting a key resolver and returning a new frozen keyed facade sharing the cache.\n *\n * @example\n *\n * ```ts\n * import { createLruKeyedStore } from '@kikiutils/shared/storages/lru/keyed-store';\n * import { LRUCache } from 'lru-cache';\n *\n * const cache = new LRUCache<string, { name: string }>({ max: 100 });\n * const keyedStore = createLruKeyedStore<{ name: string }>(cache)((userId: string) => `user:${userId}`);\n * keyedStore.setItem({ name: 'Alice' }, 'user-123');\n * console.log(keyedStore.getItem('user-123')); // => { name: 'Alice' }\n * ```\n */\nexport function createLruKeyedStore<D = unknown>(lruInstance: LRUCache<any, any, any>) {\n return <P extends any[]>(keyFn: (...args: P) => string) => Object.freeze({\n /**\n * Returns the cached value and applies the underlying cache's read-recency policy.\n *\n * @returns The cached value without copying it, or `null` when absent or nullish.\n */\n getItem(...args: P) {\n const rawValue = lruInstance.get(keyFn(...args));\n return rawValue as D ?? null;\n },\n getItemTtl: (...args: P) => lruInstance.getRemainingTTL(keyFn(...args)),\n hasItem: (...args: P) => lruInstance.has(keyFn(...args)),\n removeItem: (...args: P) => lruInstance.delete(keyFn(...args)),\n /**\n * Resolves the full cache key from the given arguments.\n */\n resolveKey: (...args: P) => keyFn(...args),\n setItem: (value: D, ...args: P) => lruInstance.set(keyFn(...args), value),\n setItemWithTtl(ttlMilliseconds: number, value: D, ...args: P) {\n return lruInstance.set(keyFn(...args), value, { ttl: ttlMilliseconds });\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgB,oBAAiC,aAAsC;CACnF,QAAyB,UAAkC,OAAO,OAAO;;;;;;EAMrE,QAAQ,GAAG,MAAS;GAEhB,OADiB,YAAY,IAAI,MAAM,GAAG,IAAI,CAChC,KAAU;EAC5B;EACA,aAAa,GAAG,SAAY,YAAY,gBAAgB,MAAM,GAAG,IAAI,CAAC;EACtE,UAAU,GAAG,SAAY,YAAY,IAAI,MAAM,GAAG,IAAI,CAAC;EACvD,aAAa,GAAG,SAAY,YAAY,OAAO,MAAM,GAAG,IAAI,CAAC;;;;EAI7D,aAAa,GAAG,SAAY,MAAM,GAAG,IAAI;EACzC,UAAU,OAAU,GAAG,SAAY,YAAY,IAAI,MAAM,GAAG,IAAI,GAAG,KAAK;EACxE,eAAe,iBAAyB,OAAU,GAAG,MAAS;GAC1D,OAAO,YAAY,IAAI,MAAM,GAAG,IAAI,GAAG,OAAO,EAAE,KAAK,gBAAgB,CAAC;EAC1E;CACJ,CAAC;AACL"}
@@ -1,6 +1,5 @@
1
1
  import { MaybeReadonly } from "../../types/index.js";
2
2
  import { RedisLikeStorage } from "./types.js";
3
- //#region src/storages/redis/keyed-store.d.ts
4
3
  /**
5
4
  * Creates a keyed store factory sharing a caller-owned Redis-like storage facade.
6
5
  *
@@ -26,5 +25,4 @@ export declare function createRedisKeyedStore<D = unknown>(storage: MaybeReadonl
26
25
  setItem: (value: D, ...args: P) => Promise<boolean>;
27
26
  setItemWithTtl(ttlSeconds: number, value: D, ...args: P): Promise<boolean>;
28
27
  }>;
29
- //#endregion
30
28
  //# sourceMappingURL=keyed-store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyed-store.d.ts","names":[],"sources":["../../../src/storages/redis/keyed-store.ts"],"mappings":";;;;;;;;;;;;;;;;;;;wBAoBgB,sBAAsB,aAAa,SAAS,cAAc,qBAC9D,iBAAiB,WAAW,MAAM,iBAAY;EAC/B,aAAA,MAAA,MAAC,QAAA;EACE,gBAAA,MAAA,MAAC;EACJ,aAAA,MAAA,MAAC;EACE,gBAAA,MAAA,MAAC;EACD,gBAAA,MAAA;EACL,UAAA,OAAA,MAAC,MAAW,MAAC;EACH,eAAA,oBAAM,OAAS,MAAC,MAAW,IAAC"}
1
+ {"version":3,"file":"keyed-store.d.ts","names":[],"sources":["../../../src/storages/redis/keyed-store.ts"],"mappings":";;;;;;;;;;;;;;;;;;wBAoBgB,sBAAsB,aAAa,SAAS,cAAc,qBAC9D,iBAAiB,WAAW,MAAM,iBAAY;EAC/B,aAAA,MAAA,MAAC,QAAA;EACE,gBAAA,MAAA,MAAC;EACJ,aAAA,MAAA,MAAC;EACE,gBAAA,MAAA,MAAC;EACD,gBAAA,MAAA;EACL,UAAA,OAAA,MAAC,MAAW,MAAC;EACH,eAAA,oBAAM,OAAS,MAAC,MAAW,IAAC"}
@@ -1,4 +1,4 @@
1
- //#region src/storages/redis/keyed-store.ts
1
+ // src/storages/redis/keyed-store.ts
2
2
  /**
3
3
  * Creates a keyed store factory sharing a caller-owned Redis-like storage facade.
4
4
  *
@@ -28,7 +28,6 @@ function createRedisKeyedStore(storage) {
28
28
  }
29
29
  });
30
30
  }
31
- //#endregion
32
31
  export { createRedisKeyedStore };
33
32
 
34
33
  //# sourceMappingURL=keyed-store.js.map
@@ -1,5 +1,4 @@
1
1
  import { RedisLikeAdapter, RedisLikeStorage } from "./types.js";
2
- //#region src/storages/redis/msgpack.d.ts
3
2
  /**
4
3
  * Creates a frozen Redis-like storage facade using MessagePack serialization.
5
4
  *
@@ -42,5 +41,4 @@ import { RedisLikeAdapter, RedisLikeStorage } from "./types.js";
42
41
  * ```
43
42
  */
44
43
  export declare function createRedisMsgpackStorage(adapter: RedisLikeAdapter): Readonly<RedisLikeStorage>;
45
- //#endregion
46
44
  //# sourceMappingURL=msgpack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"msgpack.d.ts","names":[],"sources":["../../../src/storages/redis/msgpack.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwDgB,0BAA0B,SAAS,mBAAmB,SAAS"}
1
+ {"version":3,"file":"msgpack.d.ts","names":[],"sources":["../../../src/storages/redis/msgpack.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwDgB,0BAA0B,SAAS,mBAAmB,SAAS"}
@@ -1,5 +1,5 @@
1
1
  import { decode, encode, isNativeAccelerationEnabled } from "msgpackr";
2
- //#region src/storages/redis/msgpack.ts
2
+ // src/storages/redis/msgpack.ts
3
3
  if (!isNativeAccelerationEnabled) console.warn("Native acceleration not enabled for msgpackr, verify that install finished properly");
4
4
  /**
5
5
  * Creates a frozen Redis-like storage facade using MessagePack serialization.
@@ -57,7 +57,6 @@ function createRedisMsgpackStorage(adapter) {
57
57
  }
58
58
  });
59
59
  }
60
- //#endregion
61
60
  export { createRedisMsgpackStorage };
62
61
 
63
62
  //# sourceMappingURL=msgpack.js.map
@@ -1,4 +1,3 @@
1
- //#region src/storages/redis/types.d.ts
2
1
  /**
3
2
  * A caller-owned asynchronous adapter for Redis-like binary operations.
4
3
  *
@@ -75,5 +74,4 @@ export interface RedisLikeStorage {
75
74
  */
76
75
  setItemWithTtl: (key: string, ttlSeconds: number, value: any) => Promise<boolean>;
77
76
  }
78
- //#endregion
79
77
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/storages/redis/types.ts"],"mappings":";;;;;;;;iBAOiB;;;;EAIb,SAAS,gBAAgB;;;;EAKzB,YAAY,gBAAgB,eAAe;;;;EAK3C,MAAM,gBAAgB;;;;EAKtB,YAAY,aAAa,OAAO,eAAe;;;;;;;;EAS/C,cAAc,aAAa,oBAAoB,OAAO,eAAe;;;;EAKrE,MAAM,gBAAgB;;;;;;;;;iBAUT;;;;;;EAMb,UAAU,aAAa,gBAAgB,eAAe;;;;EAKtD,aAAa,gBAAgB;;;;EAK7B,UAAU,gBAAgB;;;;EAK1B,aAAa,gBAAgB;;;;EAK7B,UAAU,aAAa,eAAe;;;;;;;;EAStC,iBAAiB,aAAa,oBAAoB,eAAe"}
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/storages/redis/types.ts"],"mappings":";;;;;;;iBAOiB;;;;EAIb,SAAS,gBAAgB;;;;EAKzB,YAAY,gBAAgB,eAAe;;;;EAK3C,MAAM,gBAAgB;;;;EAKtB,YAAY,aAAa,OAAO,eAAe;;;;;;;;EAS/C,cAAc,aAAa,oBAAoB,OAAO,eAAe;;;;EAKrE,MAAM,gBAAgB;;;;;;;;;iBAUT;;;;;;EAMb,UAAU,aAAa,gBAAgB,eAAe;;;;EAKtD,aAAa,gBAAgB;;;;EAK7B,UAAU,gBAAgB;;;;EAK1B,aAAa,gBAAgB;;;;EAK7B,UAAU,aAAa,eAAe;;;;;;;;EAStC,iBAAiB,aAAa,oBAAoB,eAAe"}