lifecycleion 0.0.1

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 (177) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +125 -0
  3. package/dist/index.cjs +7 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +2 -0
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.js +5 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/lib/arrays.cjs +95 -0
  10. package/dist/lib/arrays.cjs.map +1 -0
  11. package/dist/lib/arrays.d.cts +15 -0
  12. package/dist/lib/arrays.d.ts +15 -0
  13. package/dist/lib/arrays.js +63 -0
  14. package/dist/lib/arrays.js.map +1 -0
  15. package/dist/lib/ascii-tables/index.cjs +642 -0
  16. package/dist/lib/ascii-tables/index.cjs.map +1 -0
  17. package/dist/lib/ascii-tables/index.d.cts +66 -0
  18. package/dist/lib/ascii-tables/index.d.ts +66 -0
  19. package/dist/lib/ascii-tables/index.js +603 -0
  20. package/dist/lib/ascii-tables/index.js.map +1 -0
  21. package/dist/lib/clamp.cjs +41 -0
  22. package/dist/lib/clamp.cjs.map +1 -0
  23. package/dist/lib/clamp.d.cts +26 -0
  24. package/dist/lib/clamp.d.ts +26 -0
  25. package/dist/lib/clamp.js +15 -0
  26. package/dist/lib/clamp.js.map +1 -0
  27. package/dist/lib/constants.cjs +73 -0
  28. package/dist/lib/constants.cjs.map +1 -0
  29. package/dist/lib/constants.d.cts +17 -0
  30. package/dist/lib/constants.d.ts +17 -0
  31. package/dist/lib/constants.js +34 -0
  32. package/dist/lib/constants.js.map +1 -0
  33. package/dist/lib/curly-brackets.cjs +77 -0
  34. package/dist/lib/curly-brackets.cjs.map +1 -0
  35. package/dist/lib/curly-brackets.d.cts +17 -0
  36. package/dist/lib/curly-brackets.d.ts +17 -0
  37. package/dist/lib/curly-brackets.js +52 -0
  38. package/dist/lib/curly-brackets.js.map +1 -0
  39. package/dist/lib/deep-clone.cjs +87 -0
  40. package/dist/lib/deep-clone.cjs.map +1 -0
  41. package/dist/lib/deep-clone.d.cts +19 -0
  42. package/dist/lib/deep-clone.d.ts +19 -0
  43. package/dist/lib/deep-clone.js +62 -0
  44. package/dist/lib/deep-clone.js.map +1 -0
  45. package/dist/lib/error-to-string.cjs +743 -0
  46. package/dist/lib/error-to-string.cjs.map +1 -0
  47. package/dist/lib/error-to-string.d.cts +3 -0
  48. package/dist/lib/error-to-string.d.ts +3 -0
  49. package/dist/lib/error-to-string.js +706 -0
  50. package/dist/lib/error-to-string.js.map +1 -0
  51. package/dist/lib/event-emitter.cjs +899 -0
  52. package/dist/lib/event-emitter.cjs.map +1 -0
  53. package/dist/lib/event-emitter.d.cts +78 -0
  54. package/dist/lib/event-emitter.d.ts +78 -0
  55. package/dist/lib/event-emitter.js +861 -0
  56. package/dist/lib/event-emitter.js.map +1 -0
  57. package/dist/lib/id-helpers.cjs +205 -0
  58. package/dist/lib/id-helpers.cjs.map +1 -0
  59. package/dist/lib/id-helpers.d.cts +198 -0
  60. package/dist/lib/id-helpers.d.ts +198 -0
  61. package/dist/lib/id-helpers.js +170 -0
  62. package/dist/lib/id-helpers.js.map +1 -0
  63. package/dist/lib/is-boolean.cjs +33 -0
  64. package/dist/lib/is-boolean.cjs.map +1 -0
  65. package/dist/lib/is-boolean.d.cts +19 -0
  66. package/dist/lib/is-boolean.d.ts +19 -0
  67. package/dist/lib/is-boolean.js +8 -0
  68. package/dist/lib/is-boolean.js.map +1 -0
  69. package/dist/lib/is-function.cjs +33 -0
  70. package/dist/lib/is-function.cjs.map +1 -0
  71. package/dist/lib/is-function.d.cts +3 -0
  72. package/dist/lib/is-function.d.ts +3 -0
  73. package/dist/lib/is-function.js +8 -0
  74. package/dist/lib/is-function.js.map +1 -0
  75. package/dist/lib/is-number.cjs +38 -0
  76. package/dist/lib/is-number.cjs.map +1 -0
  77. package/dist/lib/is-number.d.cts +38 -0
  78. package/dist/lib/is-number.d.ts +38 -0
  79. package/dist/lib/is-number.js +12 -0
  80. package/dist/lib/is-number.js.map +1 -0
  81. package/dist/lib/is-plain-object.cjs +33 -0
  82. package/dist/lib/is-plain-object.cjs.map +1 -0
  83. package/dist/lib/is-plain-object.d.cts +20 -0
  84. package/dist/lib/is-plain-object.d.ts +20 -0
  85. package/dist/lib/is-plain-object.js +8 -0
  86. package/dist/lib/is-plain-object.js.map +1 -0
  87. package/dist/lib/is-promise.cjs +34 -0
  88. package/dist/lib/is-promise.cjs.map +1 -0
  89. package/dist/lib/is-promise.d.cts +3 -0
  90. package/dist/lib/is-promise.d.ts +3 -0
  91. package/dist/lib/is-promise.js +9 -0
  92. package/dist/lib/is-promise.js.map +1 -0
  93. package/dist/lib/json-helpers.cjs +49 -0
  94. package/dist/lib/json-helpers.cjs.map +1 -0
  95. package/dist/lib/json-helpers.d.cts +10 -0
  96. package/dist/lib/json-helpers.d.ts +10 -0
  97. package/dist/lib/json-helpers.js +22 -0
  98. package/dist/lib/json-helpers.js.map +1 -0
  99. package/dist/lib/lifecycle-manager/index.cjs +5594 -0
  100. package/dist/lib/lifecycle-manager/index.cjs.map +1 -0
  101. package/dist/lib/lifecycle-manager/index.d.cts +2044 -0
  102. package/dist/lib/lifecycle-manager/index.d.ts +2044 -0
  103. package/dist/lib/lifecycle-manager/index.js +5543 -0
  104. package/dist/lib/lifecycle-manager/index.js.map +1 -0
  105. package/dist/lib/logger/index.cjs +2514 -0
  106. package/dist/lib/logger/index.cjs.map +1 -0
  107. package/dist/lib/logger/index.d.cts +630 -0
  108. package/dist/lib/logger/index.d.ts +630 -0
  109. package/dist/lib/logger/index.js +2470 -0
  110. package/dist/lib/logger/index.js.map +1 -0
  111. package/dist/lib/padding-utils.cjs +77 -0
  112. package/dist/lib/padding-utils.cjs.map +1 -0
  113. package/dist/lib/padding-utils.d.cts +44 -0
  114. package/dist/lib/padding-utils.d.ts +44 -0
  115. package/dist/lib/padding-utils.js +46 -0
  116. package/dist/lib/padding-utils.js.map +1 -0
  117. package/dist/lib/process-signal-manager.cjs +1306 -0
  118. package/dist/lib/process-signal-manager.cjs.map +1 -0
  119. package/dist/lib/process-signal-manager.d.cts +305 -0
  120. package/dist/lib/process-signal-manager.d.ts +305 -0
  121. package/dist/lib/process-signal-manager.js +1269 -0
  122. package/dist/lib/process-signal-manager.js.map +1 -0
  123. package/dist/lib/promise-protected-resolver.cjs +828 -0
  124. package/dist/lib/promise-protected-resolver.cjs.map +1 -0
  125. package/dist/lib/promise-protected-resolver.d.cts +17 -0
  126. package/dist/lib/promise-protected-resolver.d.ts +17 -0
  127. package/dist/lib/promise-protected-resolver.js +791 -0
  128. package/dist/lib/promise-protected-resolver.js.map +1 -0
  129. package/dist/lib/retry-utils/index.cjs +2183 -0
  130. package/dist/lib/retry-utils/index.cjs.map +1 -0
  131. package/dist/lib/retry-utils/index.d.cts +321 -0
  132. package/dist/lib/retry-utils/index.d.ts +321 -0
  133. package/dist/lib/retry-utils/index.js +2133 -0
  134. package/dist/lib/retry-utils/index.js.map +1 -0
  135. package/dist/lib/safe-handle-callback.cjs +818 -0
  136. package/dist/lib/safe-handle-callback.cjs.map +1 -0
  137. package/dist/lib/safe-handle-callback.d.cts +43 -0
  138. package/dist/lib/safe-handle-callback.d.ts +43 -0
  139. package/dist/lib/safe-handle-callback.js +780 -0
  140. package/dist/lib/safe-handle-callback.js.map +1 -0
  141. package/dist/lib/serialize-error/index.cjs +93 -0
  142. package/dist/lib/serialize-error/index.cjs.map +1 -0
  143. package/dist/lib/serialize-error/index.d.cts +26 -0
  144. package/dist/lib/serialize-error/index.d.ts +26 -0
  145. package/dist/lib/serialize-error/index.js +64 -0
  146. package/dist/lib/serialize-error/index.js.map +1 -0
  147. package/dist/lib/single-event-observer.cjs +841 -0
  148. package/dist/lib/single-event-observer.cjs.map +1 -0
  149. package/dist/lib/single-event-observer.d.cts +54 -0
  150. package/dist/lib/single-event-observer.d.ts +54 -0
  151. package/dist/lib/single-event-observer.js +803 -0
  152. package/dist/lib/single-event-observer.js.map +1 -0
  153. package/dist/lib/sleep.cjs +37 -0
  154. package/dist/lib/sleep.cjs.map +1 -0
  155. package/dist/lib/sleep.d.cts +11 -0
  156. package/dist/lib/sleep.d.ts +11 -0
  157. package/dist/lib/sleep.js +12 -0
  158. package/dist/lib/sleep.js.map +1 -0
  159. package/dist/lib/strings.cjs +186 -0
  160. package/dist/lib/strings.cjs.map +1 -0
  161. package/dist/lib/strings.d.cts +107 -0
  162. package/dist/lib/strings.d.ts +107 -0
  163. package/dist/lib/strings.js +149 -0
  164. package/dist/lib/strings.js.map +1 -0
  165. package/dist/lib/tmp-dir.cjs +254 -0
  166. package/dist/lib/tmp-dir.cjs.map +1 -0
  167. package/dist/lib/tmp-dir.d.cts +63 -0
  168. package/dist/lib/tmp-dir.d.ts +63 -0
  169. package/dist/lib/tmp-dir.js +211 -0
  170. package/dist/lib/tmp-dir.js.map +1 -0
  171. package/dist/lib/unix-time-helpers.cjs +53 -0
  172. package/dist/lib/unix-time-helpers.cjs.map +1 -0
  173. package/dist/lib/unix-time-helpers.d.cts +56 -0
  174. package/dist/lib/unix-time-helpers.d.ts +56 -0
  175. package/dist/lib/unix-time-helpers.js +24 -0
  176. package/dist/lib/unix-time-helpers.js.map +1 -0
  177. package/package.json +220 -0
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Type guard to check if a value is a valid number.
3
+ *
4
+ * @param value - Value to check
5
+ * @returns `true` if the value is a number and not NaN, `false` otherwise
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * isNumber(42); // true
10
+ * isNumber(3.14); // true
11
+ * isNumber(NaN); // false
12
+ * isNumber('123'); // false
13
+ * isNumber(null); // false
14
+ * isNumber(undefined); // false
15
+ * ```
16
+ */
17
+ declare function isNumber(value: unknown): value is number;
18
+ /**
19
+ * Type guard to check if a value is a finite number.
20
+ *
21
+ * @param value - Value to check
22
+ * @returns `true` if the value is a number and is finite (excludes NaN, Infinity, -Infinity), `false` otherwise
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * isFiniteNumber(42); // true
27
+ * isFiniteNumber(3.14); // true
28
+ * isFiniteNumber(Infinity); // false
29
+ * isFiniteNumber(-Infinity); // false
30
+ * isFiniteNumber(NaN); // false
31
+ * isFiniteNumber('123'); // false
32
+ * isFiniteNumber(null); // false
33
+ * isFiniteNumber(undefined); // false
34
+ * ```
35
+ */
36
+ declare function isFiniteNumber(value: unknown): value is number;
37
+
38
+ export { isFiniteNumber, isNumber };
@@ -0,0 +1,12 @@
1
+ // src/lib/is-number.ts
2
+ function isNumber(value) {
3
+ return typeof value === "number" && !isNaN(value);
4
+ }
5
+ function isFiniteNumber(value) {
6
+ return typeof value === "number" && isFinite(value);
7
+ }
8
+ export {
9
+ isFiniteNumber,
10
+ isNumber
11
+ };
12
+ //# sourceMappingURL=is-number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/is-number.ts"],"sourcesContent":["/**\n * Type guard to check if a value is a valid number.\n *\n * @param value - Value to check\n * @returns `true` if the value is a number and not NaN, `false` otherwise\n *\n * @example\n * ```typescript\n * isNumber(42); // true\n * isNumber(3.14); // true\n * isNumber(NaN); // false\n * isNumber('123'); // false\n * isNumber(null); // false\n * isNumber(undefined); // false\n * ```\n */\nexport function isNumber(value: unknown): value is number {\n return typeof value === 'number' && !isNaN(value);\n}\n\n/**\n * Type guard to check if a value is a finite number.\n *\n * @param value - Value to check\n * @returns `true` if the value is a number and is finite (excludes NaN, Infinity, -Infinity), `false` otherwise\n *\n * @example\n * ```typescript\n * isFiniteNumber(42); // true\n * isFiniteNumber(3.14); // true\n * isFiniteNumber(Infinity); // false\n * isFiniteNumber(-Infinity); // false\n * isFiniteNumber(NaN); // false\n * isFiniteNumber('123'); // false\n * isFiniteNumber(null); // false\n * isFiniteNumber(undefined); // false\n * ```\n */\nexport function isFiniteNumber(value: unknown): value is number {\n return typeof value === 'number' && isFinite(value);\n}\n"],"mappings":";AAgBO,SAAS,SAAS,OAAiC;AACxD,SAAO,OAAO,UAAU,YAAY,CAAC,MAAM,KAAK;AAClD;AAoBO,SAAS,eAAe,OAAiC;AAC9D,SAAO,OAAO,UAAU,YAAY,SAAS,KAAK;AACpD;","names":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/is-plain-object.ts
21
+ var is_plain_object_exports = {};
22
+ __export(is_plain_object_exports, {
23
+ isPlainObject: () => isPlainObject
24
+ });
25
+ module.exports = __toCommonJS(is_plain_object_exports);
26
+ function isPlainObject(value) {
27
+ return typeof value === "object" && value !== null && !Array.isArray(value);
28
+ }
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ isPlainObject
32
+ });
33
+ //# sourceMappingURL=is-plain-object.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/is-plain-object.ts"],"sourcesContent":["/**\n * Type guard to check if a value is a plain object (not null, not an array).\n *\n * @param value - Value to check\n * @returns `true` if the value is a plain object, `false` otherwise\n *\n * @example\n * ```typescript\n * isPlainObject({}); // true\n * isPlainObject({ a: 1 }); // true\n * isPlainObject([]); // false\n * isPlainObject(null); // false\n * isPlainObject(undefined); // false\n * isPlainObject('string'); // false\n * isPlainObject(42); // false\n * ```\n */\nexport function isPlainObject(\n value: unknown,\n): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBO,SAAS,cACd,OACkC;AAClC,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;","names":[]}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Type guard to check if a value is a plain object (not null, not an array).
3
+ *
4
+ * @param value - Value to check
5
+ * @returns `true` if the value is a plain object, `false` otherwise
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * isPlainObject({}); // true
10
+ * isPlainObject({ a: 1 }); // true
11
+ * isPlainObject([]); // false
12
+ * isPlainObject(null); // false
13
+ * isPlainObject(undefined); // false
14
+ * isPlainObject('string'); // false
15
+ * isPlainObject(42); // false
16
+ * ```
17
+ */
18
+ declare function isPlainObject(value: unknown): value is Record<string, unknown>;
19
+
20
+ export { isPlainObject };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Type guard to check if a value is a plain object (not null, not an array).
3
+ *
4
+ * @param value - Value to check
5
+ * @returns `true` if the value is a plain object, `false` otherwise
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * isPlainObject({}); // true
10
+ * isPlainObject({ a: 1 }); // true
11
+ * isPlainObject([]); // false
12
+ * isPlainObject(null); // false
13
+ * isPlainObject(undefined); // false
14
+ * isPlainObject('string'); // false
15
+ * isPlainObject(42); // false
16
+ * ```
17
+ */
18
+ declare function isPlainObject(value: unknown): value is Record<string, unknown>;
19
+
20
+ export { isPlainObject };
@@ -0,0 +1,8 @@
1
+ // src/lib/is-plain-object.ts
2
+ function isPlainObject(value) {
3
+ return typeof value === "object" && value !== null && !Array.isArray(value);
4
+ }
5
+ export {
6
+ isPlainObject
7
+ };
8
+ //# sourceMappingURL=is-plain-object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/is-plain-object.ts"],"sourcesContent":["/**\n * Type guard to check if a value is a plain object (not null, not an array).\n *\n * @param value - Value to check\n * @returns `true` if the value is a plain object, `false` otherwise\n *\n * @example\n * ```typescript\n * isPlainObject({}); // true\n * isPlainObject({ a: 1 }); // true\n * isPlainObject([]); // false\n * isPlainObject(null); // false\n * isPlainObject(undefined); // false\n * isPlainObject('string'); // false\n * isPlainObject(42); // false\n * ```\n */\nexport function isPlainObject(\n value: unknown,\n): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"],"mappings":";AAiBO,SAAS,cACd,OACkC;AAClC,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;","names":[]}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/is-promise.ts
21
+ var is_promise_exports = {};
22
+ __export(is_promise_exports, {
23
+ isPromise: () => isPromise
24
+ });
25
+ module.exports = __toCommonJS(is_promise_exports);
26
+ function isPromise(obj) {
27
+ return !!obj && (typeof obj === "object" || typeof obj === "function") && // @ts-expect-error - obj is checked to be object/function, then property access works at runtime
28
+ typeof obj["then"] === "function";
29
+ }
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ isPromise
33
+ });
34
+ //# sourceMappingURL=is-promise.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/is-promise.ts"],"sourcesContent":["// Helper from https://github.com/then/is-promise/tree/master\n// For some reason the @types/is-promise package stopped being picked up on\n\nexport function isPromise(obj: unknown): obj is Promise<unknown> {\n return (\n !!obj &&\n (typeof obj === 'object' || typeof obj === 'function') &&\n // @ts-expect-error - obj is checked to be object/function, then property access works at runtime\n typeof obj['then'] === 'function'\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,SAAS,UAAU,KAAuC;AAC/D,SACE,CAAC,CAAC,QACD,OAAO,QAAQ,YAAY,OAAO,QAAQ;AAAA,EAE3C,OAAO,IAAI,MAAM,MAAM;AAE3B;","names":[]}
@@ -0,0 +1,3 @@
1
+ declare function isPromise(obj: unknown): obj is Promise<unknown>;
2
+
3
+ export { isPromise };
@@ -0,0 +1,3 @@
1
+ declare function isPromise(obj: unknown): obj is Promise<unknown>;
2
+
3
+ export { isPromise };
@@ -0,0 +1,9 @@
1
+ // src/lib/is-promise.ts
2
+ function isPromise(obj) {
3
+ return !!obj && (typeof obj === "object" || typeof obj === "function") && // @ts-expect-error - obj is checked to be object/function, then property access works at runtime
4
+ typeof obj["then"] === "function";
5
+ }
6
+ export {
7
+ isPromise
8
+ };
9
+ //# sourceMappingURL=is-promise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/is-promise.ts"],"sourcesContent":["// Helper from https://github.com/then/is-promise/tree/master\n// For some reason the @types/is-promise package stopped being picked up on\n\nexport function isPromise(obj: unknown): obj is Promise<unknown> {\n return (\n !!obj &&\n (typeof obj === 'object' || typeof obj === 'function') &&\n // @ts-expect-error - obj is checked to be object/function, then property access works at runtime\n typeof obj['then'] === 'function'\n );\n}\n"],"mappings":";AAGO,SAAS,UAAU,KAAuC;AAC/D,SACE,CAAC,CAAC,QACD,OAAO,QAAQ,YAAY,OAAO,QAAQ;AAAA,EAE3C,OAAO,IAAI,MAAM,MAAM;AAE3B;","names":[]}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/json-helpers.ts
21
+ var json_helpers_exports = {};
22
+ __export(json_helpers_exports, {
23
+ formatJSON: () => formatJSON
24
+ });
25
+ module.exports = __toCommonJS(json_helpers_exports);
26
+
27
+ // src/lib/constants.ts
28
+ var EOL = "\n";
29
+ var DOUBLE_EOL = EOL + EOL;
30
+ var INDENT = " ".repeat(4);
31
+ var DOUBLE_INDENT = INDENT + INDENT;
32
+ var ASCII_LOWERCASE = "abcdefghijklmnopqrstuvwxyz";
33
+ var ASCII_UPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
34
+ var ASCII_LETTERS = ASCII_LOWERCASE + ASCII_UPPERCASE;
35
+ var DIGITS = "0123456789";
36
+ var HEX_DIGITS = DIGITS + "abcdefABCDEF";
37
+ var PUNCTUATION = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
38
+ var WHITESPACE = " \n\r\v\f";
39
+ var PRINTABLE = DIGITS + ASCII_LETTERS + PUNCTUATION + WHITESPACE;
40
+
41
+ // src/lib/json-helpers.ts
42
+ function formatJSON(value, isHuman = false) {
43
+ return JSON.stringify(value, null, isHuman ? 2 : 0) + (isHuman ? EOL : "");
44
+ }
45
+ // Annotate the CommonJS export names for ESM import in node:
46
+ 0 && (module.exports = {
47
+ formatJSON
48
+ });
49
+ //# sourceMappingURL=json-helpers.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/json-helpers.ts","../../src/lib/constants.ts"],"sourcesContent":["import { EOL } from './constants';\n\n/**\n * Formats a JSON value as a string.\n *\n * @param value - The value to format as JSON.\n * @param isHuman - Optional boolean to format JSON for human readability. Defaults to false.\n * @returns The formatted JSON string.\n */\n\nexport function formatJSON(value: unknown, isHuman: boolean = false): string {\n return JSON.stringify(value, null, isHuman ? 2 : 0) + (isHuman ? EOL : '');\n}\n","// prettier-ignore\nexport const BLANK_SPACE = ' ';\n\nexport const EOL = '\\n';\nexport const DOUBLE_EOL = EOL + EOL;\nexport const INDENT = ' '.repeat(4);\nexport const DOUBLE_INDENT = INDENT + INDENT;\n\n// prettier-ignore\nexport const SINGLE_QUOTE = \"'\";\n\n// similar to Python string library\nexport const ASCII_LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';\nexport const ASCII_UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nexport const ASCII_LETTERS = ASCII_LOWERCASE + ASCII_UPPERCASE;\nexport const DIGITS = '0123456789';\nexport const HEX_DIGITS = DIGITS + 'abcdefABCDEF';\nexport const OCT_DIGITS = '01234567';\nexport const PUNCTUATION = '!\"#$%&\\'()*+,-./:;<=>?@[\\\\]^_`{|}~';\nexport const WHITESPACE = ' \\t\\n\\r\\v\\f';\nexport const PRINTABLE = DIGITS + ASCII_LETTERS + PUNCTUATION + WHITESPACE;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,MAAM;AACZ,IAAM,aAAa,MAAM;AACzB,IAAM,SAAS,IAAI,OAAO,CAAC;AAC3B,IAAM,gBAAgB,SAAS;AAM/B,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AACxB,IAAM,gBAAgB,kBAAkB;AACxC,IAAM,SAAS;AACf,IAAM,aAAa,SAAS;AAE5B,IAAM,cAAc;AACpB,IAAM,aAAa;AACnB,IAAM,YAAY,SAAS,gBAAgB,cAAc;;;ADVzD,SAAS,WAAW,OAAgB,UAAmB,OAAe;AAC3E,SAAO,KAAK,UAAU,OAAO,MAAM,UAAU,IAAI,CAAC,KAAK,UAAU,MAAM;AACzE;","names":[]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Formats a JSON value as a string.
3
+ *
4
+ * @param value - The value to format as JSON.
5
+ * @param isHuman - Optional boolean to format JSON for human readability. Defaults to false.
6
+ * @returns The formatted JSON string.
7
+ */
8
+ declare function formatJSON(value: unknown, isHuman?: boolean): string;
9
+
10
+ export { formatJSON };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Formats a JSON value as a string.
3
+ *
4
+ * @param value - The value to format as JSON.
5
+ * @param isHuman - Optional boolean to format JSON for human readability. Defaults to false.
6
+ * @returns The formatted JSON string.
7
+ */
8
+ declare function formatJSON(value: unknown, isHuman?: boolean): string;
9
+
10
+ export { formatJSON };
@@ -0,0 +1,22 @@
1
+ // src/lib/constants.ts
2
+ var EOL = "\n";
3
+ var DOUBLE_EOL = EOL + EOL;
4
+ var INDENT = " ".repeat(4);
5
+ var DOUBLE_INDENT = INDENT + INDENT;
6
+ var ASCII_LOWERCASE = "abcdefghijklmnopqrstuvwxyz";
7
+ var ASCII_UPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
8
+ var ASCII_LETTERS = ASCII_LOWERCASE + ASCII_UPPERCASE;
9
+ var DIGITS = "0123456789";
10
+ var HEX_DIGITS = DIGITS + "abcdefABCDEF";
11
+ var PUNCTUATION = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
12
+ var WHITESPACE = " \n\r\v\f";
13
+ var PRINTABLE = DIGITS + ASCII_LETTERS + PUNCTUATION + WHITESPACE;
14
+
15
+ // src/lib/json-helpers.ts
16
+ function formatJSON(value, isHuman = false) {
17
+ return JSON.stringify(value, null, isHuman ? 2 : 0) + (isHuman ? EOL : "");
18
+ }
19
+ export {
20
+ formatJSON
21
+ };
22
+ //# sourceMappingURL=json-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/constants.ts","../../src/lib/json-helpers.ts"],"sourcesContent":["// prettier-ignore\nexport const BLANK_SPACE = ' ';\n\nexport const EOL = '\\n';\nexport const DOUBLE_EOL = EOL + EOL;\nexport const INDENT = ' '.repeat(4);\nexport const DOUBLE_INDENT = INDENT + INDENT;\n\n// prettier-ignore\nexport const SINGLE_QUOTE = \"'\";\n\n// similar to Python string library\nexport const ASCII_LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';\nexport const ASCII_UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nexport const ASCII_LETTERS = ASCII_LOWERCASE + ASCII_UPPERCASE;\nexport const DIGITS = '0123456789';\nexport const HEX_DIGITS = DIGITS + 'abcdefABCDEF';\nexport const OCT_DIGITS = '01234567';\nexport const PUNCTUATION = '!\"#$%&\\'()*+,-./:;<=>?@[\\\\]^_`{|}~';\nexport const WHITESPACE = ' \\t\\n\\r\\v\\f';\nexport const PRINTABLE = DIGITS + ASCII_LETTERS + PUNCTUATION + WHITESPACE;\n","import { EOL } from './constants';\n\n/**\n * Formats a JSON value as a string.\n *\n * @param value - The value to format as JSON.\n * @param isHuman - Optional boolean to format JSON for human readability. Defaults to false.\n * @returns The formatted JSON string.\n */\n\nexport function formatJSON(value: unknown, isHuman: boolean = false): string {\n return JSON.stringify(value, null, isHuman ? 2 : 0) + (isHuman ? EOL : '');\n}\n"],"mappings":";AAGO,IAAM,MAAM;AACZ,IAAM,aAAa,MAAM;AACzB,IAAM,SAAS,IAAI,OAAO,CAAC;AAC3B,IAAM,gBAAgB,SAAS;AAM/B,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AACxB,IAAM,gBAAgB,kBAAkB;AACxC,IAAM,SAAS;AACf,IAAM,aAAa,SAAS;AAE5B,IAAM,cAAc;AACpB,IAAM,aAAa;AACnB,IAAM,YAAY,SAAS,gBAAgB,cAAc;;;ACVzD,SAAS,WAAW,OAAgB,UAAmB,OAAe;AAC3E,SAAO,KAAK,UAAU,OAAO,MAAM,UAAU,IAAI,CAAC,KAAK,UAAU,MAAM;AACzE;","names":[]}