@ls-stack/utils 3.40.0 → 3.42.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 (159) hide show
  1. package/dist/arrayUtils.d.cts +70 -57
  2. package/dist/arrayUtils.d.ts +70 -57
  3. package/dist/assertions.d.cts +128 -117
  4. package/dist/assertions.d.ts +128 -117
  5. package/dist/asyncQueue.cjs +117 -112
  6. package/dist/asyncQueue.d.cts +217 -215
  7. package/dist/asyncQueue.d.ts +217 -215
  8. package/dist/asyncQueue.js +117 -112
  9. package/dist/awaitDebounce.d.cts +26 -23
  10. package/dist/awaitDebounce.d.ts +26 -23
  11. package/dist/cache.cjs +2 -1
  12. package/dist/cache.d.cts +15 -9
  13. package/dist/cache.d.ts +15 -9
  14. package/dist/cache.js +2 -1
  15. package/dist/{chunk-ADM37GSC.js → chunk-7L4KCZJJ.js} +12 -10
  16. package/dist/{chunk-KW55OTUG.js → chunk-B3KFV2MH.js} +2 -2
  17. package/dist/chunk-GMJTLFM6.js +60 -0
  18. package/dist/{chunk-GHAQOUA6.js → chunk-Y45CE75W.js} +22 -1
  19. package/dist/concurrentCalls.d.cts +8 -4
  20. package/dist/concurrentCalls.d.ts +8 -4
  21. package/dist/concurrentCalls.js +1 -1
  22. package/dist/debounce.d.cts +12 -20
  23. package/dist/debounce.d.ts +12 -20
  24. package/dist/dedent.d.cts +31 -31
  25. package/dist/dedent.d.ts +31 -31
  26. package/dist/deepEqual.d.cts +10 -9
  27. package/dist/deepEqual.d.ts +10 -9
  28. package/dist/filterObjectOrArrayKeys.d.cts +44 -19
  29. package/dist/filterObjectOrArrayKeys.d.ts +44 -19
  30. package/dist/getAutoIncrementId.d.cts +25 -23
  31. package/dist/getAutoIncrementId.d.ts +25 -23
  32. package/dist/getCompositeKey.d.cts +2 -1
  33. package/dist/getCompositeKey.d.ts +2 -1
  34. package/dist/getValueStableKey.d.cts +4 -3
  35. package/dist/getValueStableKey.d.ts +4 -3
  36. package/dist/mutationUtils.d.cts +2 -2
  37. package/dist/mutationUtils.d.ts +2 -2
  38. package/dist/objUtils.cjs +51 -2
  39. package/dist/objUtils.d.cts +8 -3
  40. package/dist/objUtils.d.ts +8 -3
  41. package/dist/objUtils.js +11 -3
  42. package/dist/parallelAsyncCalls.cjs +2 -1
  43. package/dist/parallelAsyncCalls.d.cts +5 -4
  44. package/dist/parallelAsyncCalls.d.ts +5 -4
  45. package/dist/parallelAsyncCalls.js +2 -1
  46. package/dist/retryOnError.d.cts +23 -20
  47. package/dist/retryOnError.d.ts +23 -20
  48. package/dist/runShellCmd.d.cts +40 -40
  49. package/dist/runShellCmd.d.ts +40 -40
  50. package/dist/safeJson.d.cts +6 -2
  51. package/dist/safeJson.d.ts +6 -2
  52. package/dist/saferTyping.d.cts +21 -14
  53. package/dist/saferTyping.d.ts +21 -14
  54. package/dist/shallowEqual.d.cts +1 -1
  55. package/dist/shallowEqual.d.ts +1 -1
  56. package/dist/stringUtils.cjs +2 -2
  57. package/dist/stringUtils.d.cts +6 -7
  58. package/dist/stringUtils.d.ts +6 -7
  59. package/dist/stringUtils.js +1 -1
  60. package/dist/testUtils.cjs +11 -9
  61. package/dist/testUtils.d.cts +32 -14
  62. package/dist/testUtils.d.ts +32 -14
  63. package/dist/testUtils.js +4 -3
  64. package/dist/throttle.d.cts +57 -48
  65. package/dist/throttle.d.ts +57 -48
  66. package/dist/timers.d.cts +68 -63
  67. package/dist/timers.d.ts +68 -63
  68. package/dist/tsResult.d.cts +7 -6
  69. package/dist/tsResult.d.ts +7 -6
  70. package/dist/typeGuards.d.cts +65 -64
  71. package/dist/typeGuards.d.ts +65 -64
  72. package/dist/typeUtils.d.cts +18 -4
  73. package/dist/typeUtils.d.ts +18 -4
  74. package/dist/typedStrings.d.cts +68 -57
  75. package/dist/typedStrings.d.ts +68 -57
  76. package/dist/typingFnUtils.cjs +15 -0
  77. package/dist/typingFnUtils.d.cts +34 -7
  78. package/dist/typingFnUtils.d.ts +34 -7
  79. package/dist/typingFnUtils.js +18 -35
  80. package/dist/typingTestUtils.cjs +7 -1
  81. package/dist/typingTestUtils.d.cts +52 -11
  82. package/dist/typingTestUtils.d.ts +52 -11
  83. package/dist/typingTestUtils.js +7 -1
  84. package/dist/typingUtils.d.cts +4 -1
  85. package/dist/typingUtils.d.ts +4 -1
  86. package/dist/yamlStringify.cjs +11 -9
  87. package/dist/yamlStringify.js +2 -2
  88. package/package.json +5 -1
  89. package/docs/README.md +0 -72
  90. package/docs/_media/modules.md +0 -58
  91. package/docs/arrayUtils/-internal-.md +0 -179
  92. package/docs/arrayUtils/README.md +0 -550
  93. package/docs/assertions/-internal-.md +0 -63
  94. package/docs/assertions/README.md +0 -565
  95. package/docs/asyncQueue/-internal-.md +0 -297
  96. package/docs/asyncQueue/README.md +0 -1485
  97. package/docs/awaitDebounce.md +0 -66
  98. package/docs/cache/-internal-.md +0 -168
  99. package/docs/cache/README.md +0 -360
  100. package/docs/castValues.md +0 -47
  101. package/docs/concurrentCalls/-internal-.md +0 -490
  102. package/docs/concurrentCalls/README.md +0 -299
  103. package/docs/consoleFmt.md +0 -115
  104. package/docs/conversions.md +0 -27
  105. package/docs/createThrottleController/-internal-.md +0 -73
  106. package/docs/createThrottleController/README.md +0 -31
  107. package/docs/debounce.md +0 -188
  108. package/docs/dedent/-internal-.md +0 -17
  109. package/docs/dedent/README.md +0 -204
  110. package/docs/deepEqual.md +0 -94
  111. package/docs/enhancedMap.md +0 -358
  112. package/docs/exhaustiveMatch/-internal-.md +0 -39
  113. package/docs/exhaustiveMatch/README.md +0 -146
  114. package/docs/filterObjectOrArrayKeys.md +0 -109
  115. package/docs/getAutoIncrementId.md +0 -93
  116. package/docs/getCompositeKey.md +0 -39
  117. package/docs/getValueStableKey.md +0 -57
  118. package/docs/hash.md +0 -31
  119. package/docs/interpolate/-internal-.md +0 -61
  120. package/docs/interpolate/README.md +0 -62
  121. package/docs/keepPrevIfUnchanged.md +0 -43
  122. package/docs/levenshtein.md +0 -93
  123. package/docs/main.md +0 -21
  124. package/docs/mathUtils.md +0 -137
  125. package/docs/modules.md +0 -58
  126. package/docs/mutationUtils.md +0 -44
  127. package/docs/objUtils.md +0 -237
  128. package/docs/parallelAsyncCalls/-internal-.md +0 -347
  129. package/docs/parallelAsyncCalls/README.md +0 -45
  130. package/docs/promiseUtils/-internal-.md +0 -69
  131. package/docs/promiseUtils/README.md +0 -31
  132. package/docs/retryOnError/-internal-.md +0 -111
  133. package/docs/retryOnError/README.md +0 -168
  134. package/docs/runShellCmd/-internal-.md +0 -111
  135. package/docs/runShellCmd/README.md +0 -201
  136. package/docs/safeJson.md +0 -51
  137. package/docs/saferTyping.md +0 -228
  138. package/docs/serializeXML.md +0 -100
  139. package/docs/shallowEqual.md +0 -33
  140. package/docs/sleep.md +0 -27
  141. package/docs/stringUtils/-internal-.md +0 -17
  142. package/docs/stringUtils/README.md +0 -270
  143. package/docs/testUtils.md +0 -382
  144. package/docs/throttle/-internal-.md +0 -47
  145. package/docs/throttle/README.md +0 -178
  146. package/docs/time.md +0 -274
  147. package/docs/timers.md +0 -256
  148. package/docs/tsResult/-internal-.md +0 -327
  149. package/docs/tsResult/README.md +0 -702
  150. package/docs/typeGuards.md +0 -399
  151. package/docs/typeUtils/-internal-.md +0 -99
  152. package/docs/typeUtils/README.md +0 -195
  153. package/docs/typeUtils.typesTest.md +0 -7
  154. package/docs/typedStrings.md +0 -458
  155. package/docs/typingFnUtils/-internal-.md +0 -43
  156. package/docs/typingFnUtils/README.md +0 -317
  157. package/docs/typingTestUtils.md +0 -172
  158. package/docs/typingUtils.md +0 -135
  159. package/docs/yamlStringify.md +0 -83
@@ -1,45 +1,28 @@
1
- // src/typingFnUtils.ts
2
- function asNonPartial(obj) {
3
- return obj;
4
- }
5
- function typedObjectEntries(obj) {
6
- return Object.entries(obj);
7
- }
8
- function typedObjectKeys(obj) {
9
- return Object.keys(obj);
10
- }
11
- function asType(value) {
12
- return value;
13
- }
14
- function narrowStringToUnion(key, union) {
15
- if (!key) return void 0;
16
- if (union instanceof Set) {
17
- return union.has(key) ? key : void 0;
18
- }
19
- if (union.includes(key)) {
20
- return key;
21
- }
22
- return void 0;
23
- }
24
- function typeOnRightExtendsLeftType() {
25
- return void 0;
26
- }
27
- var isSubTypeOf = typeOnRightExtendsLeftType;
28
- function isObjKey(key, obj) {
29
- return typeof key === "string" && key in obj;
30
- }
31
- function unionsAreTheSame(_diff) {
32
- }
33
- function asPartialUndefinedValues(value) {
34
- return value;
35
- }
1
+ import {
2
+ asNonPartial,
3
+ asPartialUndefinedValues,
4
+ asType,
5
+ isNonEmptyArray,
6
+ isObjKey,
7
+ isSubTypeOf,
8
+ narrowStringToUnion,
9
+ objectHasKey,
10
+ strictTypedObjectEntries,
11
+ typeOnRightExtendsLeftType,
12
+ typedObjectEntries,
13
+ typedObjectKeys,
14
+ unionsAreTheSame
15
+ } from "./chunk-GMJTLFM6.js";
36
16
  export {
37
17
  asNonPartial,
38
18
  asPartialUndefinedValues,
39
19
  asType,
20
+ isNonEmptyArray,
40
21
  isObjKey,
41
22
  isSubTypeOf,
42
23
  narrowStringToUnion,
24
+ objectHasKey,
25
+ strictTypedObjectEntries,
43
26
  typeOnRightExtendsLeftType,
44
27
  typedObjectEntries,
45
28
  typedObjectKeys,
@@ -34,11 +34,17 @@ function expectType() {
34
34
  }
35
35
  function expectTypesAre(result) {
36
36
  }
37
+ function expectTypesAreEqual(...result) {
38
+ }
39
+ function expectTypesAreNotEqual(...result) {
40
+ }
37
41
  var typingTest = {
38
42
  test,
39
43
  describe,
40
44
  expectType,
41
- expectTypesAre
45
+ expectTypesAre,
46
+ expectTypesAreEqual,
47
+ expectTypesAreNotEqual
42
48
  };
43
49
  // Annotate the CommonJS export names for ESM import in node:
44
50
  0 && (module.exports = {
@@ -3,36 +3,77 @@ type TestTypeNotEqual<X, Y> = true extends TestTypeIsEqual<X, Y> ? false : true;
3
3
  declare function test(title: string, func: () => any): void;
4
4
  declare function describe(title: string, func: () => any): void;
5
5
  /**
6
- * Helper function for type testing that ensures a type extends `true`.
7
- * Used in combination with `TestTypeIsEqual` to verify type equality at compile time.
6
+ * Helper function for type testing that ensures a type extends `true`. Used in
7
+ * combination with `TestTypeIsEqual` to verify type equality at compile time.
8
8
  *
9
+ * @deprecated Use {@link expectTypesAreEqual} or {@link expectTypesAreNotEqual}
10
+ * instead
9
11
  * @example
10
- * expectType<TestTypeIsEqual<string, string>>(); // OK
11
- * expectType<TestTypeIsEqual<string, number>>(); // Type error
12
+ * expectType<TestTypeIsEqual<string, string>>(); // OK
13
+ * expectType<TestTypeIsEqual<string, number>>(); // Type error
12
14
  *
13
15
  * @template T Type that must extend `true`
14
16
  * @returns An empty object cast to type T
15
17
  */
16
18
  declare function expectType<T extends true>(): T;
17
19
  /**
18
- * Helper function for type testing that compares two types and expects a specific result.
19
- * This function allows for more explicit type equality assertions with a descriptive result.
20
+ * Helper function for type testing that compares two types and expects a
21
+ * specific result. This function allows for more explicit type equality
22
+ * assertions with a descriptive result.
23
+ *
24
+ * @deprecated Use {@link expectTypesAreEqual} or {@link expectTypesAreNotEqual}
25
+ * instead
26
+ * @example
27
+ * expectTypesAre<string, string>('equal'); // OK
28
+ * expectTypesAre<string, number>('notEqual'); // OK
29
+ * expectTypesAre<string, string>('notEqual'); // Type error
30
+ *
31
+ * @template X First type to compare
32
+ * @template Y Second type to compare
33
+ * @param result Expected comparison result: 'equal' if types are equal,
34
+ * 'notEqual' if they differ
35
+ */
36
+ declare function expectTypesAre<X, Y>(result: TestTypeIsEqual<X, Y> extends true ? 'equal' : 'notEqual'): void;
37
+ /**
38
+ * Helper function for type testing that ensures two types are equal. If types
39
+ * are not equal, it will show a compile-time error with details about the
40
+ * mismatch.
41
+ *
42
+ * @example
43
+ * expectTypesAreEqual<string, string>(); // OK
44
+ * expectTypesAreEqual<string, number>(); // Compile error with details
20
45
  *
21
46
  * @template X First type to compare
22
47
  * @template Y Second type to compare
23
- * @param result Expected comparison result: 'equal' if types are equal, 'notEqual' if they differ
48
+ * @param result Optional error parameter that appears only when types don't
49
+ * match
50
+ */
51
+ declare function expectTypesAreEqual<X, Y>(...result: TestTypeIsEqual<X, Y> extends true ? [] : [
52
+ error: 'type assertion failed, types should be equal but',
53
+ typeOnLeft: X,
54
+ _: 'is not equal to',
55
+ typeOnRight: Y
56
+ ]): void;
57
+ /**
58
+ * Helper function for type testing that ensures two types are not equal. If
59
+ * types are equal, it will show a compile-time error.
24
60
  *
25
61
  * @example
26
- * expectTypesAre<string, string>('equal'); // OK
27
- * expectTypesAre<string, number>('notEqual'); // OK
28
- * expectTypesAre<string, string>('notEqual'); // Type error
62
+ * expectTypesAreNotEqual<string, number>(); // OK
63
+ * expectTypesAreNotEqual<string, string>(); // Compile error
64
+ *
65
+ * @template X First type to compare
66
+ * @template Y Second type to compare
67
+ * @param result Optional error parameter that appears only when types match
29
68
  */
30
- declare function expectTypesAre<X, Y>(result: TestTypeIsEqual<X, Y> extends true ? 'equal' : 'notEqual'): void;
69
+ declare function expectTypesAreNotEqual<X, Y>(...result: TestTypeIsEqual<X, Y> extends false ? [] : ['error: type assertion failed, types should be NOT equal']): void;
31
70
  declare const typingTest: {
32
71
  test: typeof test;
33
72
  describe: typeof describe;
34
73
  expectType: typeof expectType;
35
74
  expectTypesAre: typeof expectTypesAre;
75
+ expectTypesAreEqual: typeof expectTypesAreEqual;
76
+ expectTypesAreNotEqual: typeof expectTypesAreNotEqual;
36
77
  };
37
78
 
38
79
  export { type TestTypeIsEqual, type TestTypeNotEqual, typingTest };
@@ -3,36 +3,77 @@ type TestTypeNotEqual<X, Y> = true extends TestTypeIsEqual<X, Y> ? false : true;
3
3
  declare function test(title: string, func: () => any): void;
4
4
  declare function describe(title: string, func: () => any): void;
5
5
  /**
6
- * Helper function for type testing that ensures a type extends `true`.
7
- * Used in combination with `TestTypeIsEqual` to verify type equality at compile time.
6
+ * Helper function for type testing that ensures a type extends `true`. Used in
7
+ * combination with `TestTypeIsEqual` to verify type equality at compile time.
8
8
  *
9
+ * @deprecated Use {@link expectTypesAreEqual} or {@link expectTypesAreNotEqual}
10
+ * instead
9
11
  * @example
10
- * expectType<TestTypeIsEqual<string, string>>(); // OK
11
- * expectType<TestTypeIsEqual<string, number>>(); // Type error
12
+ * expectType<TestTypeIsEqual<string, string>>(); // OK
13
+ * expectType<TestTypeIsEqual<string, number>>(); // Type error
12
14
  *
13
15
  * @template T Type that must extend `true`
14
16
  * @returns An empty object cast to type T
15
17
  */
16
18
  declare function expectType<T extends true>(): T;
17
19
  /**
18
- * Helper function for type testing that compares two types and expects a specific result.
19
- * This function allows for more explicit type equality assertions with a descriptive result.
20
+ * Helper function for type testing that compares two types and expects a
21
+ * specific result. This function allows for more explicit type equality
22
+ * assertions with a descriptive result.
23
+ *
24
+ * @deprecated Use {@link expectTypesAreEqual} or {@link expectTypesAreNotEqual}
25
+ * instead
26
+ * @example
27
+ * expectTypesAre<string, string>('equal'); // OK
28
+ * expectTypesAre<string, number>('notEqual'); // OK
29
+ * expectTypesAre<string, string>('notEqual'); // Type error
30
+ *
31
+ * @template X First type to compare
32
+ * @template Y Second type to compare
33
+ * @param result Expected comparison result: 'equal' if types are equal,
34
+ * 'notEqual' if they differ
35
+ */
36
+ declare function expectTypesAre<X, Y>(result: TestTypeIsEqual<X, Y> extends true ? 'equal' : 'notEqual'): void;
37
+ /**
38
+ * Helper function for type testing that ensures two types are equal. If types
39
+ * are not equal, it will show a compile-time error with details about the
40
+ * mismatch.
41
+ *
42
+ * @example
43
+ * expectTypesAreEqual<string, string>(); // OK
44
+ * expectTypesAreEqual<string, number>(); // Compile error with details
20
45
  *
21
46
  * @template X First type to compare
22
47
  * @template Y Second type to compare
23
- * @param result Expected comparison result: 'equal' if types are equal, 'notEqual' if they differ
48
+ * @param result Optional error parameter that appears only when types don't
49
+ * match
50
+ */
51
+ declare function expectTypesAreEqual<X, Y>(...result: TestTypeIsEqual<X, Y> extends true ? [] : [
52
+ error: 'type assertion failed, types should be equal but',
53
+ typeOnLeft: X,
54
+ _: 'is not equal to',
55
+ typeOnRight: Y
56
+ ]): void;
57
+ /**
58
+ * Helper function for type testing that ensures two types are not equal. If
59
+ * types are equal, it will show a compile-time error.
24
60
  *
25
61
  * @example
26
- * expectTypesAre<string, string>('equal'); // OK
27
- * expectTypesAre<string, number>('notEqual'); // OK
28
- * expectTypesAre<string, string>('notEqual'); // Type error
62
+ * expectTypesAreNotEqual<string, number>(); // OK
63
+ * expectTypesAreNotEqual<string, string>(); // Compile error
64
+ *
65
+ * @template X First type to compare
66
+ * @template Y Second type to compare
67
+ * @param result Optional error parameter that appears only when types match
29
68
  */
30
- declare function expectTypesAre<X, Y>(result: TestTypeIsEqual<X, Y> extends true ? 'equal' : 'notEqual'): void;
69
+ declare function expectTypesAreNotEqual<X, Y>(...result: TestTypeIsEqual<X, Y> extends false ? [] : ['error: type assertion failed, types should be NOT equal']): void;
31
70
  declare const typingTest: {
32
71
  test: typeof test;
33
72
  describe: typeof describe;
34
73
  expectType: typeof expectType;
35
74
  expectTypesAre: typeof expectTypesAre;
75
+ expectTypesAreEqual: typeof expectTypesAreEqual;
76
+ expectTypesAreNotEqual: typeof expectTypesAreNotEqual;
36
77
  };
37
78
 
38
79
  export { type TestTypeIsEqual, type TestTypeNotEqual, typingTest };
@@ -10,11 +10,17 @@ function expectType() {
10
10
  }
11
11
  function expectTypesAre(result) {
12
12
  }
13
+ function expectTypesAreEqual(...result) {
14
+ }
15
+ function expectTypesAreNotEqual(...result) {
16
+ }
13
17
  var typingTest = {
14
18
  test,
15
19
  describe,
16
20
  expectType,
17
- expectTypesAre
21
+ expectTypesAre,
22
+ expectTypesAreEqual,
23
+ expectTypesAreNotEqual
18
24
  };
19
25
  export {
20
26
  typingTest
@@ -6,7 +6,10 @@ type PartialRecord<K extends keyof any, T> = {
6
6
  type NonPartial<T> = {
7
7
  [K in keyof Required<T>]: T[K];
8
8
  };
9
- /** @deprecated Use `ObjKeysWithValuesOfType` from `@ls-stack/utils/typeUtils` instead */
9
+ /**
10
+ * @deprecated Use `ObjKeysWithValuesOfType` from `@ls-stack/utils/typeUtils`
11
+ * instead
12
+ */
10
13
  type ObjKeysWithValuesOfType<Obj extends Record<PropertyKey, unknown>, ValueType> = {
11
14
  [K in keyof Obj]: Obj[K] extends ValueType ? K : never;
12
15
  }[keyof Obj];
@@ -6,7 +6,10 @@ type PartialRecord<K extends keyof any, T> = {
6
6
  type NonPartial<T> = {
7
7
  [K in keyof Required<T>]: T[K];
8
8
  };
9
- /** @deprecated Use `ObjKeysWithValuesOfType` from `@ls-stack/utils/typeUtils` instead */
9
+ /**
10
+ * @deprecated Use `ObjKeysWithValuesOfType` from `@ls-stack/utils/typeUtils`
11
+ * instead
12
+ */
10
13
  type ObjKeysWithValuesOfType<Obj extends Record<PropertyKey, unknown>, ValueType> = {
11
14
  [K in keyof Obj]: Obj[K] extends ValueType ? K : never;
12
15
  }[keyof Obj];
@@ -88,14 +88,12 @@ function stringifyValue(value, indent, maxLineLength, showUndefined, maxDepth, d
88
88
  const entries = Object.entries(value).filter(
89
89
  ([, val]) => val !== void 0 || showUndefined
90
90
  );
91
- const isSimpleObject = entries.every(
92
- ([, val]) => {
93
- if (typeof val === "string") {
94
- return !val.includes("'") && !val.includes('"') && !val.includes("\\");
95
- }
96
- return typeof val === "number" || typeof val === "boolean" || val === null || val === void 0;
91
+ const isSimpleObject = entries.every(([, val]) => {
92
+ if (typeof val === "string") {
93
+ return !val.includes("'") && !val.includes('"') && !val.includes("\\");
97
94
  }
98
- );
95
+ return typeof val === "number" || typeof val === "boolean" || val === null || val === void 0;
96
+ });
99
97
  const shouldCollapse = isArrayItem ? entries.length > 1 : entries.length > 0;
100
98
  if (isSimpleObject && shouldCollapse) {
101
99
  let line = "{ ";
@@ -148,7 +146,9 @@ function stringifyValue(value, indent, maxLineLength, showUndefined, maxDepth, d
148
146
  false
149
147
  );
150
148
  const willBeCollapsed = isObject(objVal) && (Object.keys(objVal).length === 0 || collapseObjects && depth + 1 > 0 && (() => {
151
- const filteredEntries = Object.entries(objVal).filter(([, val]) => val !== void 0 || showUndefined);
149
+ const filteredEntries = Object.entries(objVal).filter(
150
+ ([, val]) => val !== void 0 || showUndefined
151
+ );
152
152
  const shouldCollapseThis = isArrayItem ? filteredEntries.length > 1 : filteredEntries.length > 0;
153
153
  return shouldCollapseThis && filteredEntries.every(([, val]) => {
154
154
  if (typeof val === "string") {
@@ -158,7 +158,9 @@ function stringifyValue(value, indent, maxLineLength, showUndefined, maxDepth, d
158
158
  });
159
159
  })());
160
160
  const prevWasCollapsed = prevValue && isObject(prevValue) && (Object.keys(prevValue).length === 0 || collapseObjects && depth + 1 > 0 && (() => {
161
- const filteredEntries = Object.entries(prevValue).filter(([, val]) => val !== void 0 || showUndefined);
161
+ const filteredEntries = Object.entries(prevValue).filter(
162
+ ([, val]) => val !== void 0 || showUndefined
163
+ );
162
164
  const shouldCollapseThis = isArrayItem ? filteredEntries.length > 1 : filteredEntries.length > 0;
163
165
  return shouldCollapseThis && filteredEntries.every(([, val]) => {
164
166
  if (typeof val === "string") {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  yamlStringify
3
- } from "./chunk-ADM37GSC.js";
3
+ } from "./chunk-7L4KCZJJ.js";
4
4
  import "./chunk-IATIXMCE.js";
5
- import "./chunk-KW55OTUG.js";
5
+ import "./chunk-B3KFV2MH.js";
6
6
  import "./chunk-JF2MDHOJ.js";
7
7
  export {
8
8
  yamlStringify
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ls-stack/utils",
3
3
  "description": "Universal TypeScript utilities for browser and Node.js",
4
- "version": "3.40.0",
4
+ "version": "3.42.0",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "dist",
@@ -212,6 +212,10 @@
212
212
  "import": "./dist/typingTestUtils.js",
213
213
  "require": "./dist/typingTestUtils.cjs"
214
214
  },
215
+ "./typingTestUtils.typesTest": {
216
+ "import": "./dist/typingTestUtils.typesTest.js",
217
+ "require": "./dist/typingTestUtils.typesTest.cjs"
218
+ },
215
219
  "./typingUtils": {
216
220
  "import": "./dist/typingUtils.js",
217
221
  "require": "./dist/typingUtils.cjs"
package/docs/README.md DELETED
@@ -1,72 +0,0 @@
1
- **@ls-stack/utils**
2
-
3
- ***
4
-
5
- # @ls-stack/utils
6
-
7
- Generic TypeScript utilities for modern JavaScript/TypeScript projects.
8
-
9
- ## Installation
10
-
11
- ```bash
12
- npm install @ls-stack/utils
13
- # or
14
- pnpm add @ls-stack/utils
15
- # or
16
- yarn add @ls-stack/utils
17
- ```
18
-
19
- ## Usage
20
-
21
- Import specific utilities from their modules:
22
-
23
- ```typescript
24
- import { createAsyncQueue } from '@ls-stack/utils/asyncQueue';
25
- import { deepEqual } from '@ls-stack/utils/deepEqual';
26
- import { debounce } from '@ls-stack/utils/debounce';
27
- ```
28
-
29
- ## Documentation
30
-
31
- For a complete list of available utilities and their APIs, see the auto-generated documentation in the [`docs/`](docs/) folder. Start with the [modules overview](_media/modules.md) to explore all available utilities.
32
-
33
- ### Generating Documentation
34
-
35
- To regenerate the documentation after making changes:
36
-
37
- ```bash
38
- pnpm docs
39
- ```
40
-
41
- For continuous updates during development:
42
-
43
- ```bash
44
- pnpm docs:watch
45
- ```
46
-
47
- ## Development
48
-
49
- ```bash
50
- # Install dependencies
51
- pnpm install
52
-
53
- # Run tests
54
- pnpm test
55
-
56
- # Run tests with UI
57
- pnpm test:ui
58
-
59
- # Build the library
60
- pnpm build
61
-
62
- # Lint code
63
- pnpm lint
64
- ```
65
-
66
- ## License
67
-
68
- MIT
69
-
70
- ## Repository
71
-
72
- [github:lucasols/utils](https://github.com/lucasols/utils)
@@ -1,58 +0,0 @@
1
- [**@ls-stack/utils**](README.md)
2
-
3
- ***
4
-
5
- # @ls-stack/utils
6
-
7
- ## Modules
8
-
9
- - [arrayUtils](arrayUtils/README.md)
10
- - [assertions](assertions/README.md)
11
- - [asyncQueue](asyncQueue/README.md)
12
- - [awaitDebounce](awaitDebounce.md)
13
- - [cache](cache/README.md)
14
- - [castValues](castValues.md)
15
- - [concurrentCalls](concurrentCalls/README.md)
16
- - [consoleFmt](consoleFmt.md)
17
- - [conversions](conversions.md)
18
- - [createThrottleController](createThrottleController/README.md)
19
- - [debounce](debounce.md)
20
- - [dedent](dedent/README.md)
21
- - [deepEqual](deepEqual.md)
22
- - [enhancedMap](enhancedMap.md)
23
- - [exhaustiveMatch](exhaustiveMatch/README.md)
24
- - [filterObjectOrArrayKeys](filterObjectOrArrayKeys.md)
25
- - [getAutoIncrementId](getAutoIncrementId.md)
26
- - [getCompositeKey](getCompositeKey.md)
27
- - [getValueStableKey](getValueStableKey.md)
28
- - [hash](hash.md)
29
- - [interpolate](interpolate/README.md)
30
- - [keepPrevIfUnchanged](keepPrevIfUnchanged.md)
31
- - [levenshtein](levenshtein.md)
32
- - [main](main.md)
33
- - [mathUtils](mathUtils.md)
34
- - [mutationUtils](mutationUtils.md)
35
- - [objUtils](objUtils.md)
36
- - [parallelAsyncCalls](parallelAsyncCalls/README.md)
37
- - [promiseUtils](promiseUtils/README.md)
38
- - [retryOnError](retryOnError/README.md)
39
- - [runShellCmd](runShellCmd/README.md)
40
- - [safeJson](safeJson.md)
41
- - [saferTyping](saferTyping.md)
42
- - [serializeXML](serializeXML.md)
43
- - [shallowEqual](shallowEqual.md)
44
- - [sleep](sleep.md)
45
- - [stringUtils](stringUtils/README.md)
46
- - [testUtils](testUtils.md)
47
- - [throttle](throttle/README.md)
48
- - [time](time.md)
49
- - [timers](timers.md)
50
- - [tsResult](tsResult/README.md)
51
- - [typedStrings](typedStrings.md)
52
- - [typeGuards](typeGuards.md)
53
- - [typeUtils](typeUtils/README.md)
54
- - [typeUtils.typesTest](typeUtils.typesTest.md)
55
- - [typingFnUtils](typingFnUtils/README.md)
56
- - [typingTestUtils](typingTestUtils.md)
57
- - [typingUtils](typingUtils.md)
58
- - [yamlStringify](yamlStringify.md)