@ls-stack/utils 3.69.0 → 3.70.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 (41) hide show
  1. package/dist/arrayUtils.mjs +1 -1
  2. package/dist/{assertions-B9119Soz.mjs → assertions--46HN4J7.mjs} +1 -1
  3. package/dist/assertions.mjs +1 -1
  4. package/dist/asyncQueue.mjs +1 -1
  5. package/dist/cache.mjs +2 -2
  6. package/dist/castValues.mjs +1 -1
  7. package/dist/concurrentCalls.mjs +3 -3
  8. package/dist/conversions.mjs +1 -1
  9. package/dist/createThrottleController.mjs +1 -1
  10. package/dist/deepEqual.mjs +1 -1
  11. package/dist/deepReplaceValues.mjs +1 -1
  12. package/dist/enhancedMap.mjs +1 -1
  13. package/dist/filterObjectOrArrayKeys.mjs +1 -1
  14. package/dist/getCompositeKey.mjs +1 -1
  15. package/dist/getDiffs.d.mts +16 -0
  16. package/dist/getDiffs.mjs +202 -0
  17. package/dist/interpolate.mjs +2 -2
  18. package/dist/keepPrevIfUnchanged.mjs +1 -1
  19. package/dist/mathUtils.mjs +1 -1
  20. package/dist/mockList.mjs +1 -1
  21. package/dist/mutationUtils.mjs +1 -1
  22. package/dist/objUtils.mjs +1 -1
  23. package/dist/parallelAsyncCalls.mjs +1 -1
  24. package/dist/partialEqual.mjs +1 -1
  25. package/dist/serializeXML.mjs +1 -1
  26. package/dist/stringUtils.mjs +1 -1
  27. package/dist/testUtils.mjs +4 -4
  28. package/dist/{time-BJXm2Xv6.mjs → time-BeJWLHQb.mjs} +2 -2
  29. package/dist/time.mjs +1 -1
  30. package/dist/tsResult.mjs +1 -1
  31. package/dist/typeGuards.mjs +1 -1
  32. package/dist/typingFnUtils.mjs +1 -1
  33. package/dist/yamlStringify.mjs +3 -3
  34. package/package.json +2 -1
  35. /package/dist/{castValues-BPls1LFT.mjs → castValues-BA2XDJkl.mjs} +0 -0
  36. /package/dist/{conversions-DAWknpNd.mjs → conversions-D1BTRFdQ.mjs} +0 -0
  37. /package/dist/{deepEqual-CJIwfxEt.mjs → deepEqual-Du3EHxxo.mjs} +0 -0
  38. /package/dist/{mathUtils-Cl8qZbfS.mjs → mathUtils-FkPKduxv.mjs} +0 -0
  39. /package/dist/{stringUtils-e-95_mNH.mjs → stringUtils-CUANTYJs.mjs} +0 -0
  40. /package/dist/{typeGuards-CSaHQdO9.mjs → typeGuards-CjiEoecn.mjs} +0 -0
  41. /package/dist/{typingFnUtils-OK4g7kki.mjs → typingFnUtils-y_SiKalk.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { a as isFunction } from "./assertions-B9119Soz.mjs";
1
+ import { a as isFunction } from "./assertions--46HN4J7.mjs";
2
2
 
3
3
  //#region src/arrayUtils.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { a as isPlainObject$1, i as isObject$1, n as isFunction$1, o as isPromise$1 } from "./typeGuards-CSaHQdO9.mjs";
1
+ import { a as isPlainObject$1, i as isObject$1, n as isFunction$1, o as isPromise$1 } from "./typeGuards-CjiEoecn.mjs";
2
2
 
3
3
  //#region src/assertions.ts
4
4
  const undefErrMsg = "not undefined assertion failed";
@@ -1,3 +1,3 @@
1
- import { a as isFunction, c as isPromise, i as invariant, l as notNullish, n as assertIsNotUndefined, o as isObject, r as exhaustiveCheck, s as isPlainObject, t as assertIsNotNullish, u as notUndefined } from "./assertions-B9119Soz.mjs";
1
+ import { a as isFunction, c as isPromise, i as invariant, l as notNullish, n as assertIsNotUndefined, o as isObject, r as exhaustiveCheck, s as isPlainObject, t as assertIsNotNullish, u as notUndefined } from "./assertions--46HN4J7.mjs";
2
2
 
3
3
  export { assertIsNotNullish, assertIsNotUndefined, exhaustiveCheck, invariant, isFunction, isObject, isPlainObject, isPromise, notNullish, notUndefined };
@@ -1,5 +1,5 @@
1
1
  import { defer } from "./promiseUtils.mjs";
2
- import { p as durationObjToMs } from "./time-BJXm2Xv6.mjs";
2
+ import { p as durationObjToMs } from "./time-BeJWLHQb.mjs";
3
3
  import { evtmitter } from "evtmitter";
4
4
  import { Result, isResult, resultify, unknownToError } from "t-result";
5
5
 
package/dist/cache.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { c as isPromise } from "./assertions-B9119Soz.mjs";
2
- import { p as durationObjToMs } from "./time-BJXm2Xv6.mjs";
1
+ import { c as isPromise } from "./assertions--46HN4J7.mjs";
2
+ import { p as durationObjToMs } from "./time-BeJWLHQb.mjs";
3
3
 
4
4
  //#region src/cache.ts
5
5
  /**
@@ -1,3 +1,3 @@
1
- import { n as castToString, t as castToNumber } from "./castValues-BPls1LFT.mjs";
1
+ import { n as castToString, t as castToNumber } from "./castValues-BA2XDJkl.mjs";
2
2
 
3
3
  export { castToNumber, castToString };
@@ -1,9 +1,9 @@
1
- import { i as isObject, o as isPromise } from "./typeGuards-CSaHQdO9.mjs";
2
- import { i as invariant } from "./assertions-B9119Soz.mjs";
1
+ import { i as isObject, o as isPromise } from "./typeGuards-CjiEoecn.mjs";
2
+ import { i as invariant } from "./assertions--46HN4J7.mjs";
3
3
  import { truncateArray } from "./arrayUtils.mjs";
4
4
  import { safeJsonStringify } from "./safeJson.mjs";
5
5
  import { sleep } from "./sleep.mjs";
6
- import { C as truncateString } from "./stringUtils-e-95_mNH.mjs";
6
+ import { C as truncateString } from "./stringUtils-CUANTYJs.mjs";
7
7
  import { Result, resultify, unknownToError } from "t-result";
8
8
 
9
9
  //#region src/concurrentCalls.ts
@@ -1,3 +1,3 @@
1
- import { t as bytesToHumanReadable } from "./conversions-DAWknpNd.mjs";
1
+ import { t as bytesToHumanReadable } from "./conversions-D1BTRFdQ.mjs";
2
2
 
3
3
  export { bytesToHumanReadable };
@@ -1,4 +1,4 @@
1
- import { p as durationObjToMs } from "./time-BJXm2Xv6.mjs";
1
+ import { p as durationObjToMs } from "./time-BeJWLHQb.mjs";
2
2
  import { EnhancedMap } from "./enhancedMap.mjs";
3
3
 
4
4
  //#region src/createThrottleController.ts
@@ -1,3 +1,3 @@
1
- import { n as deepEqualWithMaxDepth, t as deepEqual } from "./deepEqual-CJIwfxEt.mjs";
1
+ import { n as deepEqualWithMaxDepth, t as deepEqual } from "./deepEqual-Du3EHxxo.mjs";
2
2
 
3
3
  export { deepEqual, deepEqualWithMaxDepth };
@@ -1,4 +1,4 @@
1
- import { a as isPlainObject } from "./typeGuards-CSaHQdO9.mjs";
1
+ import { a as isPlainObject } from "./typeGuards-CjiEoecn.mjs";
2
2
 
3
3
  //#region src/deepReplaceValues.ts
4
4
  function applyValueReplacements(value, replaceValues, visited, currentPath) {
@@ -1,4 +1,4 @@
1
- import { a as isFunction } from "./assertions-B9119Soz.mjs";
1
+ import { a as isFunction } from "./assertions--46HN4J7.mjs";
2
2
 
3
3
  //#region src/enhancedMap.ts
4
4
  const enhancedMapReject = Symbol();
@@ -1,4 +1,4 @@
1
- import { a as isPlainObject } from "./typeGuards-CSaHQdO9.mjs";
1
+ import { a as isPlainObject } from "./typeGuards-CjiEoecn.mjs";
2
2
  import { sortBy } from "./arrayUtils.mjs";
3
3
 
4
4
  //#region src/filterObjectOrArrayKeys.ts
@@ -1,4 +1,4 @@
1
- import { o as isObject } from "./assertions-B9119Soz.mjs";
1
+ import { o as isObject } from "./assertions--46HN4J7.mjs";
2
2
 
3
3
  //#region src/getCompositeKey.ts
4
4
  /**
@@ -0,0 +1,16 @@
1
+ //#region src/getDiffs.d.ts
2
+ declare const addKeysName = "++keys_added";
3
+ declare const removeKeysName = "--keys_removed";
4
+ declare const updateKeysName = "~~keys_updated";
5
+ type ObjDiffsKeys = typeof addKeysName | typeof removeKeysName | typeof updateKeysName;
6
+ declare function getDiffs(oldValue: unknown, newValue: unknown, {
7
+ ignoreDiffs,
8
+ ignoreKeys,
9
+ skipIdKey
10
+ }?: {
11
+ ignoreDiffs?: ObjDiffsKeys[];
12
+ ignoreKeys?: string[];
13
+ skipIdKey?: boolean;
14
+ }): Record<string, unknown> | undefined;
15
+ //#endregion
16
+ export { getDiffs };
@@ -0,0 +1,202 @@
1
+ import { i as isObject } from "./typeGuards-CjiEoecn.mjs";
2
+ import { l as notNullish } from "./assertions--46HN4J7.mjs";
3
+ import { sortBy } from "./arrayUtils.mjs";
4
+ import { t as deepEqual } from "./deepEqual-Du3EHxxo.mjs";
5
+ import { omit } from "./objUtils.mjs";
6
+ import { __LEGIT_ANY_CAST__, __UNSAFE_TO_STRING__ } from "./saferTyping.mjs";
7
+
8
+ //#region src/getDiffs.ts
9
+ function jsonClone(value) {
10
+ if (value === void 0) return value;
11
+ return JSON.parse(JSON.stringify(value));
12
+ }
13
+ const addKeysName = "++keys_added";
14
+ const removeKeysName = "--keys_removed";
15
+ const updateKeysName = "~~keys_updated";
16
+ function getDiffs(oldValue, newValue, { ignoreDiffs, ignoreKeys, skipIdKey } = {}) {
17
+ if (deepEqual(oldValue, newValue)) return void 0;
18
+ if (!isObject(oldValue) || !isObject(newValue)) return {
19
+ "--old": oldValue,
20
+ "++new": newValue
21
+ };
22
+ const diffs = {
23
+ [addKeysName]: {},
24
+ [removeKeysName]: {},
25
+ [updateKeysName]: {}
26
+ };
27
+ const extraInfo = {};
28
+ const removeKeys = /* @__PURE__ */ new Set();
29
+ for (const [key, value] of Object.entries(oldValue)) {
30
+ if (ignoreKeys?.includes(key)) continue;
31
+ if (newValue[key] === void 0 && value !== void 0) {
32
+ notNullish(diffs[removeKeysName])[key] = value;
33
+ removeKeys.add(key);
34
+ }
35
+ }
36
+ for (const [key, value] of Object.entries(newValue)) {
37
+ if (ignoreKeys?.includes(key) || removeKeys.has(key)) continue;
38
+ if (oldValue[key] === void 0 && value !== void 0) notNullish(diffs[addKeysName])[key] = value;
39
+ else if (!deepEqual(jsonClone(oldValue[key]), jsonClone(value))) {
40
+ const updated = notNullish(diffs[updateKeysName]);
41
+ const old = oldValue[key];
42
+ const simplifiedDiffResult = getSimplifiedDiff(old, value);
43
+ updated[typeof simplifiedDiffResult !== "string" && simplifiedDiffResult !== void 0 && "++new" in simplifiedDiffResult ? key : Array.isArray(old) && Array.isArray(value) ? `${key}~~array_changes` : key] = simplifiedDiffResult;
44
+ }
45
+ }
46
+ if (ignoreDiffs?.includes(addKeysName) || Object.keys(diffs[addKeysName] ?? {}).length === 0) delete diffs[addKeysName];
47
+ if (ignoreDiffs?.includes(removeKeysName) || Object.keys(diffs[removeKeysName] ?? {}).length === 0) delete diffs[removeKeysName];
48
+ if (ignoreDiffs?.includes(updateKeysName) || diffs[updateKeysName] && Object.keys(diffs[updateKeysName]).length === 0) delete diffs[updateKeysName];
49
+ function checkIdKey(key) {
50
+ if (!isObject(newValue) || !isObject(oldValue)) return false;
51
+ if (key in newValue && key in oldValue && newValue[key] === oldValue[key]) {
52
+ const val = newValue[key];
53
+ if (typeof val === "string" || typeof val === "number") {
54
+ extraInfo[key] = __UNSAFE_TO_STRING__(val);
55
+ return true;
56
+ }
57
+ }
58
+ return false;
59
+ }
60
+ if (Object.keys(diffs).length !== 0 && !skipIdKey) {
61
+ if (!checkIdKey("id")) checkIdKey("key");
62
+ }
63
+ const result = {
64
+ ...extraInfo,
65
+ ...diffs
66
+ };
67
+ if (Object.keys(result).length === 0) return void 0;
68
+ return result;
69
+ }
70
+ function isPrimitive(value) {
71
+ return value === null || value === void 0 || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
72
+ }
73
+ function isSmallArray(value) {
74
+ return JSON.stringify(value).length <= 80;
75
+ }
76
+ function getArrayDiffs(old, newValue) {
77
+ const diffs = {};
78
+ let allItemsHaveKey = null;
79
+ for (const item of old) if (isObject(item)) if ((allItemsHaveKey === null || allItemsHaveKey === "id") && "id" in item && isPrimitive(item.id)) allItemsHaveKey = "id";
80
+ else if ((allItemsHaveKey === null || allItemsHaveKey === "key") && "key" in item && isPrimitive(item.key)) allItemsHaveKey = "key";
81
+ else {
82
+ allItemsHaveKey = false;
83
+ break;
84
+ }
85
+ else {
86
+ allItemsHaveKey = false;
87
+ break;
88
+ }
89
+ if (allItemsHaveKey) {
90
+ for (const item of newValue) if (isObject(item)) {
91
+ if (item[allItemsHaveKey] === void 0) {
92
+ allItemsHaveKey = false;
93
+ break;
94
+ }
95
+ }
96
+ }
97
+ if (allItemsHaveKey) return arrayDiffFromItemsWithIds(__LEGIT_ANY_CAST__(old), __LEGIT_ANY_CAST__(newValue), allItemsHaveKey);
98
+ if (newValue.every((item) => old.some((oldItem) => deepEqual(oldItem, item)))) return null;
99
+ if (isSmallArray(newValue) && isSmallArray(old)) return null;
100
+ if (Math.min(newValue.length, old.length) / Math.max(newValue.length, old.length) < .5) return null;
101
+ diffs.size = newValue.length === old.length ? newValue.length : [
102
+ old.length,
103
+ "->",
104
+ newValue.length
105
+ ];
106
+ for (const [index, value] of newValue.entries()) {
107
+ const oldValue = old[index];
108
+ const indexString = `[${index}]${index === newValue.length - 1 ? "(last_item)" : ""}`;
109
+ if (!deepEqual(oldValue, value)) if (oldValue === void 0) diffs[`${indexString}_added`] = value;
110
+ else if (value === void 0) diffs[`${indexString}_removed`] = oldValue;
111
+ else diffs[indexString] = getSimplifiedDiff(oldValue, value, "array");
112
+ }
113
+ if (old.length > newValue.length) {
114
+ for (const [index, value] of old.entries()) if (index >= newValue.length) diffs[`[${index}]_removed`] = value;
115
+ }
116
+ if (Object.keys(diffs).length === 0) return null;
117
+ return diffs;
118
+ }
119
+ function arrayDiffFromItemsWithIds(oldItems, newItems, key) {
120
+ const diffs = {};
121
+ function getItemKey(item, index) {
122
+ const id = item[key];
123
+ return `[${key}: ${typeof id === "string" ? `'${id}'` : __UNSAFE_TO_STRING__(id)}]${index !== null ? `{${index}}` : ""}`;
124
+ }
125
+ const oldItemsMap = new Map(oldItems.map((item, index) => [item[key], {
126
+ item,
127
+ index
128
+ }]));
129
+ const movedItems = [];
130
+ const oldAdjustIndex = [];
131
+ const newAdjustIndex = [];
132
+ function getDisplayObj(item, idKey, emptyObjDisplay) {
133
+ const objWithoutKey = omit(item, [idKey]);
134
+ if (Object.keys(objWithoutKey).length === 0) return emptyObjDisplay;
135
+ return objWithoutKey;
136
+ }
137
+ for (const [index, item] of oldItems.entries()) if (!newItems.find((newItem) => newItem[key] === item[key])) {
138
+ diffs[`--${getItemKey(item, index)}`] = getDisplayObj(item, key, "removed");
139
+ oldAdjustIndex.push({
140
+ after: index,
141
+ delta: -1
142
+ });
143
+ }
144
+ for (const [index, item] of newItems.entries()) {
145
+ const oldItem = oldItemsMap.get(item[key]);
146
+ if (!oldItem) {
147
+ diffs[`++${getItemKey(item, index)}`] = getDisplayObj(item, key, "added");
148
+ newAdjustIndex.push({
149
+ after: index,
150
+ delta: 1
151
+ });
152
+ continue;
153
+ }
154
+ const itemChanged = !deepEqual(oldItem.item, item);
155
+ const itemMoved = oldItem.index !== index;
156
+ if (itemChanged && itemMoved) diffs[`~>${getItemKey(item, null)}·[${oldItem.index} -> ${index}]`] = getDiffs(oldItem.item, item, { skipIdKey: true });
157
+ else {
158
+ if (itemChanged) diffs[`~~${getItemKey(item, index)}`] = getDiffs(oldItem.item, item, { skipIdKey: true });
159
+ if (itemMoved) {
160
+ let expectedIndex = oldItem.index;
161
+ for (const { after, delta } of oldAdjustIndex) if (oldItem.index > after) expectedIndex += delta;
162
+ for (const { after, delta } of newAdjustIndex) if (index > after) expectedIndex += delta;
163
+ if (expectedIndex !== index) {
164
+ const diffKey = `->${getItemKey(item, null)}·[${oldItem.index} -> ${index}]`;
165
+ diffs[diffKey] = "moved";
166
+ movedItems.push({
167
+ key: diffKey,
168
+ deltaAbs: Math.abs(index - oldItem.index)
169
+ });
170
+ }
171
+ }
172
+ }
173
+ }
174
+ const biggestDelta = sortBy(movedItems, (item) => item.deltaAbs, "desc")[0]?.deltaAbs;
175
+ for (const item of movedItems) if (item.deltaAbs !== biggestDelta) delete diffs[item.key];
176
+ return diffs;
177
+ }
178
+ function getSimplifiedDiff(old, value, parentIs) {
179
+ if (isPrimitive(old) && isPrimitive(value)) {
180
+ if (JSON.stringify([
181
+ old,
182
+ "->",
183
+ value
184
+ ]).length <= 40) return [
185
+ old,
186
+ "->",
187
+ value
188
+ ];
189
+ }
190
+ if (parentIs !== "array" && Array.isArray(old) && Array.isArray(value)) {
191
+ const arrayDiffs = getArrayDiffs(old, value);
192
+ if (arrayDiffs) return arrayDiffs;
193
+ }
194
+ if (isObject(old) && isObject(value)) return getDiffs(old, value);
195
+ return {
196
+ "--old": old,
197
+ "++new": value
198
+ };
199
+ }
200
+
201
+ //#endregion
202
+ export { getDiffs };
@@ -1,5 +1,5 @@
1
- import { i as invariant } from "./assertions-B9119Soz.mjs";
2
- import { a as clampRange, i as clampMin, r as clampMax } from "./mathUtils-Cl8qZbfS.mjs";
1
+ import { i as invariant } from "./assertions--46HN4J7.mjs";
2
+ import { a as clampRange, i as clampMin, r as clampMax } from "./mathUtils-FkPKduxv.mjs";
3
3
 
4
4
  //#region src/interpolate.ts
5
5
  function mod(n, m) {
@@ -1,4 +1,4 @@
1
- import { t as deepEqual } from "./deepEqual-CJIwfxEt.mjs";
1
+ import { t as deepEqual } from "./deepEqual-Du3EHxxo.mjs";
2
2
 
3
3
  //#region src/keepPrevIfUnchanged.ts
4
4
  function keepPrevIfUnchanged({ prev, newValue, equalityFn = deepEqual }) {
@@ -1,3 +1,3 @@
1
- import { a as clampRange, c as round, i as clampMin, l as roundToStep, n as clamp, o as fixFloatingPointNumber, r as clampMax, s as floorToStep, t as ceilToStep } from "./mathUtils-Cl8qZbfS.mjs";
1
+ import { a as clampRange, c as round, i as clampMin, l as roundToStep, n as clamp, o as fixFloatingPointNumber, r as clampMax, s as floorToStep, t as ceilToStep } from "./mathUtils-FkPKduxv.mjs";
2
2
 
3
3
  export { ceilToStep, clamp, clampMax, clampMin, clampRange, fixFloatingPointNumber, floorToStep, round, roundToStep };
package/dist/mockList.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { i as invariant } from "./assertions-B9119Soz.mjs";
1
+ import { i as invariant } from "./assertions--46HN4J7.mjs";
2
2
 
3
3
  //#region src/mockList.ts
4
4
  function mockList(size, getItems) {
@@ -1,4 +1,4 @@
1
- import { n as isFunction } from "./typeGuards-CSaHQdO9.mjs";
1
+ import { n as isFunction } from "./typeGuards-CjiEoecn.mjs";
2
2
  import { keepPrevIfUnchanged } from "./keepPrevIfUnchanged.mjs";
3
3
 
4
4
  //#region src/mutationUtils.ts
package/dist/objUtils.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { sortBy } from "./arrayUtils.mjs";
2
- import { d as typedObjectEntries } from "./typingFnUtils-OK4g7kki.mjs";
2
+ import { d as typedObjectEntries } from "./typingFnUtils-y_SiKalk.mjs";
3
3
  import { Result } from "t-result";
4
4
 
5
5
  //#region src/objUtils.ts
@@ -1,4 +1,4 @@
1
- import { i as invariant, o as isObject } from "./assertions-B9119Soz.mjs";
1
+ import { i as invariant, o as isObject } from "./assertions--46HN4J7.mjs";
2
2
  import { sleep } from "./sleep.mjs";
3
3
  import { Result, unknownToError } from "t-result";
4
4
 
@@ -1,4 +1,4 @@
1
- import { r as exhaustiveCheck } from "./assertions-B9119Soz.mjs";
1
+ import { r as exhaustiveCheck } from "./assertions--46HN4J7.mjs";
2
2
  import { err, ok } from "t-result";
3
3
 
4
4
  //#region src/partialEqual.ts
@@ -1,4 +1,4 @@
1
- import { s as isTruthy } from "./typeGuards-CSaHQdO9.mjs";
1
+ import { s as isTruthy } from "./typeGuards-CjiEoecn.mjs";
2
2
  import { filterAndMap } from "./arrayUtils.mjs";
3
3
 
4
4
  //#region src/serializeXML.ts
@@ -1,3 +1,3 @@
1
- import { C as truncateString, S as removeANSIColors, _ as isPathCase, a as convertToKebabCase, b as isTitleCase, c as convertToSentenceCase, d as formatNum, f as isCamelCase, g as isPascalCase, h as isKebabCase, i as convertToDotCase, l as convertToSnakeCase, m as isDotCase, n as convertToCamelCase, o as convertToPascalCase, p as isConstantCase, r as convertToConstantCase, s as convertToPathCase, t as concatStrings, u as convertToTitleCase, v as isSentenceCase, x as joinStrings, y as isSnakeCase } from "./stringUtils-e-95_mNH.mjs";
1
+ import { C as truncateString, S as removeANSIColors, _ as isPathCase, a as convertToKebabCase, b as isTitleCase, c as convertToSentenceCase, d as formatNum, f as isCamelCase, g as isPascalCase, h as isKebabCase, i as convertToDotCase, l as convertToSnakeCase, m as isDotCase, n as convertToCamelCase, o as convertToPascalCase, p as isConstantCase, r as convertToConstantCase, s as convertToPathCase, t as concatStrings, u as convertToTitleCase, v as isSentenceCase, x as joinStrings, y as isSnakeCase } from "./stringUtils-CUANTYJs.mjs";
2
2
 
3
3
  export { concatStrings, convertToCamelCase, convertToConstantCase, convertToDotCase, convertToKebabCase, convertToPascalCase, convertToPathCase, convertToSentenceCase, convertToSnakeCase, convertToTitleCase, formatNum, isCamelCase, isConstantCase, isDotCase, isKebabCase, isPascalCase, isPathCase, isSentenceCase, isSnakeCase, isTitleCase, joinStrings, removeANSIColors, truncateString };
@@ -1,9 +1,9 @@
1
- import { a as isPlainObject } from "./typeGuards-CSaHQdO9.mjs";
2
- import { o as isObject } from "./assertions-B9119Soz.mjs";
1
+ import { a as isPlainObject } from "./typeGuards-CjiEoecn.mjs";
2
+ import { o as isObject } from "./assertions--46HN4J7.mjs";
3
3
  import { arrayWithPrevAndIndex, filterAndMap } from "./arrayUtils.mjs";
4
4
  import { defer } from "./promiseUtils.mjs";
5
- import { i as clampMin } from "./mathUtils-Cl8qZbfS.mjs";
6
- import { t as deepEqual } from "./deepEqual-CJIwfxEt.mjs";
5
+ import { i as clampMin } from "./mathUtils-FkPKduxv.mjs";
6
+ import { t as deepEqual } from "./deepEqual-Du3EHxxo.mjs";
7
7
  import { deepReplaceValues } from "./deepReplaceValues.mjs";
8
8
  import { filterObjectOrArrayKeys } from "./filterObjectOrArrayKeys.mjs";
9
9
  import { omit, pick } from "./objUtils.mjs";
@@ -1,5 +1,5 @@
1
- import { t as castToNumber } from "./castValues-BPls1LFT.mjs";
2
- import { r as clampMax } from "./mathUtils-Cl8qZbfS.mjs";
1
+ import { t as castToNumber } from "./castValues-BA2XDJkl.mjs";
2
+ import { r as clampMax } from "./mathUtils-FkPKduxv.mjs";
3
3
 
4
4
  //#region src/time.ts
5
5
  const MINUTE_AS_MS = 60 * 1e3;
package/dist/time.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { a as MINUTE_AS_MS, c as WEEK_AS_MS, d as YEAR_AS_SECS, f as dateStringOrNullToUnixMs, g as parseTimeStringToMs, h as msToTimeString, i as HOUR_AS_SECS, l as WEEK_AS_SECS, m as getUnixSeconds, n as DAY_AS_SECS, o as MONTH_AS_MS, p as durationObjToMs, r as HOUR_AS_MS, s as MONTH_AS_SECS, t as DAY_AS_MS, u as YEAR_AS_MS } from "./time-BJXm2Xv6.mjs";
1
+ import { a as MINUTE_AS_MS, c as WEEK_AS_MS, d as YEAR_AS_SECS, f as dateStringOrNullToUnixMs, g as parseTimeStringToMs, h as msToTimeString, i as HOUR_AS_SECS, l as WEEK_AS_SECS, m as getUnixSeconds, n as DAY_AS_SECS, o as MONTH_AS_MS, p as durationObjToMs, r as HOUR_AS_MS, s as MONTH_AS_SECS, t as DAY_AS_MS, u as YEAR_AS_MS } from "./time-BeJWLHQb.mjs";
2
2
 
3
3
  export { DAY_AS_MS, DAY_AS_SECS, HOUR_AS_MS, HOUR_AS_SECS, MINUTE_AS_MS, MONTH_AS_MS, MONTH_AS_SECS, WEEK_AS_MS, WEEK_AS_SECS, YEAR_AS_MS, YEAR_AS_SECS, dateStringOrNullToUnixMs, durationObjToMs, getUnixSeconds, msToTimeString, parseTimeStringToMs };
package/dist/tsResult.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as isFunction, c as isPromise, o as isObject } from "./assertions-B9119Soz.mjs";
1
+ import { a as isFunction, c as isPromise, o as isObject } from "./assertions--46HN4J7.mjs";
2
2
  import { safeJsonStringify } from "./safeJson.mjs";
3
3
 
4
4
  //#region src/tsResult.ts
@@ -1,3 +1,3 @@
1
- import { a as isPlainObject, i as isObject, n as isFunction, o as isPromise, r as isNonEmptyArray, s as isTruthy, t as arrayHasAtLeastXItems } from "./typeGuards-CSaHQdO9.mjs";
1
+ import { a as isPlainObject, i as isObject, n as isFunction, o as isPromise, r as isNonEmptyArray, s as isTruthy, t as arrayHasAtLeastXItems } from "./typeGuards-CjiEoecn.mjs";
2
2
 
3
3
  export { arrayHasAtLeastXItems, isFunction, isNonEmptyArray, isObject, isPlainObject, isPromise, isTruthy };
@@ -1,3 +1,3 @@
1
- import { a as isObjKey, c as objectHasKey, d as typedObjectEntries, f as typedObjectKeys, i as isNonEmptyArray, l as strictTypedObjectEntries, n as asPartialUndefinedValues, o as isSubTypeOf, p as unionsAreTheSame, r as asType, s as narrowStringToUnion, t as asNonPartial, u as typeOnRightExtendsLeftType } from "./typingFnUtils-OK4g7kki.mjs";
1
+ import { a as isObjKey, c as objectHasKey, d as typedObjectEntries, f as typedObjectKeys, i as isNonEmptyArray, l as strictTypedObjectEntries, n as asPartialUndefinedValues, o as isSubTypeOf, p as unionsAreTheSame, r as asType, s as narrowStringToUnion, t as asNonPartial, u as typeOnRightExtendsLeftType } from "./typingFnUtils-y_SiKalk.mjs";
2
2
 
3
3
  export { asNonPartial, asPartialUndefinedValues, asType, isNonEmptyArray, isObjKey, isSubTypeOf, narrowStringToUnion, objectHasKey, strictTypedObjectEntries, typeOnRightExtendsLeftType, typedObjectEntries, typedObjectKeys, unionsAreTheSame };
@@ -1,6 +1,6 @@
1
- import { a as isPlainObject, i as isObject } from "./typeGuards-CSaHQdO9.mjs";
2
- import { C as truncateString } from "./stringUtils-e-95_mNH.mjs";
3
- import { t as bytesToHumanReadable } from "./conversions-DAWknpNd.mjs";
1
+ import { a as isPlainObject, i as isObject } from "./typeGuards-CjiEoecn.mjs";
2
+ import { C as truncateString } from "./stringUtils-CUANTYJs.mjs";
3
+ import { t as bytesToHumanReadable } from "./conversions-D1BTRFdQ.mjs";
4
4
 
5
5
  //#region src/yamlStringify.ts
6
6
  function yamlStringify(obj, { maxLineLength = 100, showUndefined, maxDepth = 50, collapseObjects = false, addRootObjSpaces = "beforeAndAfter" } = {}) {
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.69.0",
4
+ "version": "3.70.0",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "dist",
@@ -38,6 +38,7 @@
38
38
  "./fuzzySearch": "./dist/fuzzySearch.mjs",
39
39
  "./getAutoIncrementId": "./dist/getAutoIncrementId.mjs",
40
40
  "./getCompositeKey": "./dist/getCompositeKey.mjs",
41
+ "./getDiffs": "./dist/getDiffs.mjs",
41
42
  "./getValueStableKey": "./dist/getValueStableKey.mjs",
42
43
  "./hash": "./dist/hash.mjs",
43
44
  "./interpolate": "./dist/interpolate.mjs",