@ls-stack/utils 3.66.0 → 3.68.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 (42) hide show
  1. package/dist/arrayUtils.mjs +1 -1
  2. package/dist/{assertions-qMxfVhSu.mjs → assertions-CsE3pD8P.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/diffParser.d.mts +16 -0
  13. package/dist/diffParser.mjs +15 -1
  14. package/dist/enhancedMap.mjs +1 -1
  15. package/dist/filterObjectOrArrayKeys.mjs +1 -1
  16. package/dist/fuzzySearch.d.mts +67 -0
  17. package/dist/fuzzySearch.mjs +114 -0
  18. package/dist/getCompositeKey.mjs +1 -1
  19. package/dist/interpolate.mjs +2 -2
  20. package/dist/keepPrevIfUnchanged.mjs +1 -1
  21. package/dist/mathUtils.mjs +1 -1
  22. package/dist/mutationUtils.mjs +1 -1
  23. package/dist/objUtils.mjs +1 -1
  24. package/dist/parallelAsyncCalls.mjs +1 -1
  25. package/dist/partialEqual.mjs +1 -1
  26. package/dist/serializeXML.mjs +1 -1
  27. package/dist/stringUtils.mjs +1 -1
  28. package/dist/testUtils.mjs +4 -4
  29. package/dist/{time-sr2lhQRw.mjs → time-CJSFU8a1.mjs} +2 -2
  30. package/dist/time.mjs +1 -1
  31. package/dist/tsResult.mjs +1 -1
  32. package/dist/typeGuards.mjs +1 -1
  33. package/dist/typingFnUtils.mjs +1 -1
  34. package/dist/yamlStringify.mjs +3 -3
  35. package/package.json +4 -2
  36. /package/dist/{castValues-DfICShCc.mjs → castValues-QQmtZf_x.mjs} +0 -0
  37. /package/dist/{conversions-DTmwEMIu.mjs → conversions-CWGUTE04.mjs} +0 -0
  38. /package/dist/{deepEqual-C7EZEixx.mjs → deepEqual-2xhh-diQ.mjs} +0 -0
  39. /package/dist/{mathUtils-BDP1lM_z.mjs → mathUtils-DuqyAkNL.mjs} +0 -0
  40. /package/dist/{stringUtils-DjhWOiYn.mjs → stringUtils-DEEj_Z1p.mjs} +0 -0
  41. /package/dist/{typeGuards-B1mzA-Rz.mjs → typeGuards-CMQqixVr.mjs} +0 -0
  42. /package/dist/{typingFnUtils-Bb8drgKF.mjs → typingFnUtils-BLxmDUp5.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { a as isFunction } from "./assertions-qMxfVhSu.mjs";
1
+ import { a as isFunction } from "./assertions-CsE3pD8P.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-B1mzA-Rz.mjs";
1
+ import { a as isPlainObject$1, i as isObject$1, n as isFunction$1, o as isPromise$1 } from "./typeGuards-CMQqixVr.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-qMxfVhSu.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-CsE3pD8P.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-sr2lhQRw.mjs";
2
+ import { p as durationObjToMs } from "./time-CJSFU8a1.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-qMxfVhSu.mjs";
2
- import { p as durationObjToMs } from "./time-sr2lhQRw.mjs";
1
+ import { c as isPromise } from "./assertions-CsE3pD8P.mjs";
2
+ import { p as durationObjToMs } from "./time-CJSFU8a1.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-DfICShCc.mjs";
1
+ import { n as castToString, t as castToNumber } from "./castValues-QQmtZf_x.mjs";
2
2
 
3
3
  export { castToNumber, castToString };
@@ -1,9 +1,9 @@
1
- import { i as isObject, o as isPromise } from "./typeGuards-B1mzA-Rz.mjs";
2
- import { i as invariant } from "./assertions-qMxfVhSu.mjs";
1
+ import { i as isObject, o as isPromise } from "./typeGuards-CMQqixVr.mjs";
2
+ import { i as invariant } from "./assertions-CsE3pD8P.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-DjhWOiYn.mjs";
6
+ import { C as truncateString } from "./stringUtils-DEEj_Z1p.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-DTmwEMIu.mjs";
1
+ import { t as bytesToHumanReadable } from "./conversions-CWGUTE04.mjs";
2
2
 
3
3
  export { bytesToHumanReadable };
@@ -1,4 +1,4 @@
1
- import { p as durationObjToMs } from "./time-sr2lhQRw.mjs";
1
+ import { p as durationObjToMs } from "./time-CJSFU8a1.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-C7EZEixx.mjs";
1
+ import { n as deepEqualWithMaxDepth, t as deepEqual } from "./deepEqual-2xhh-diQ.mjs";
2
2
 
3
3
  export { deepEqual, deepEqualWithMaxDepth };
@@ -1,4 +1,4 @@
1
- import { a as isPlainObject } from "./typeGuards-B1mzA-Rz.mjs";
1
+ import { a as isPlainObject } from "./typeGuards-CMQqixVr.mjs";
2
2
 
3
3
  //#region src/deepReplaceValues.ts
4
4
  function applyValueReplacements(value, replaceValues, visited, currentPath) {
@@ -36,6 +36,7 @@ interface DiffFileBase {
36
36
  newMode: string | undefined;
37
37
  index: string[] | undefined;
38
38
  diff: string | undefined;
39
+ rawDiff: string;
39
40
  }
40
41
  interface DiffFileModified extends DiffFileBase {
41
42
  type: 'modified';
@@ -57,7 +58,22 @@ interface DiffFileCombined extends DiffFileBase {
57
58
  type: 'combined';
58
59
  froms: string[] | undefined;
59
60
  }
61
+ /**
62
+ * Parsed diff file metadata and hunks.
63
+ *
64
+ * The `type` discriminator indicates the kind of change this diff represents.
65
+ * Combined diffs (e.g. `diff --cc`) may include multiple parent paths via
66
+ * `froms`.
67
+ */
60
68
  type DiffFile = DiffFileModified | DiffFileNew | DiffFileDeleted | DiffFileRenamed | DiffFileBinary | DiffFileCombined;
69
+ /**
70
+ * Parse unified diff text (git, hg, svn) into structured file hunks.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * const files = diffParser('@@ -1 +1 @@\\n-old\\n+new');
75
+ * ```;
76
+ */
61
77
  declare function diffParser(input: string): DiffFile[];
62
78
  //#endregion
63
79
  export { DiffFile, diffParser };
@@ -1,4 +1,12 @@
1
1
  //#region src/diffParser.ts
2
+ /**
3
+ * Parse unified diff text (git, hg, svn) into structured file hunks.
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * const files = diffParser('@@ -1 +1 @@\\n-old\\n+new');
8
+ * ```;
9
+ */
2
10
  function diffParser(input) {
3
11
  if (!input) return [];
4
12
  if (typeof input !== "string" || input.match(/^\s+$/)) return [];
@@ -37,7 +45,8 @@ function diffParser(input) {
37
45
  oldMode: void 0,
38
46
  newMode: void 0,
39
47
  index: void 0,
40
- diff: void 0
48
+ diff: void 0,
49
+ rawDiff: ""
41
50
  };
42
51
  fromLineCount = 0;
43
52
  pendingFroms = void 0;
@@ -84,6 +93,9 @@ function diffParser(input) {
84
93
  renamedFile.similarityIndex = Number(match[1]);
85
94
  }
86
95
  };
96
+ const indexFile = (line) => {
97
+ start(line);
98
+ };
87
99
  const renameFrom = (line) => {
88
100
  restart();
89
101
  if (currentFile) {
@@ -301,6 +313,7 @@ function diffParser(input) {
301
313
  }
302
314
  };
303
315
  const schemaHeaders = [
316
+ [/^Index:\s/, indexFile],
304
317
  [/^diff\s/, start],
305
318
  [/^new file mode (\d+)$/, newFile],
306
319
  [/^deleted file mode (\d+)$/, deletedFile],
@@ -351,6 +364,7 @@ function diffParser(input) {
351
364
  const parseLine = (line) => {
352
365
  if (currentFileChanges) parseContentLine(line);
353
366
  else parseHeaderLine(line);
367
+ if (currentFile) currentFile.rawDiff = currentFile.rawDiff.length === 0 ? line : `${currentFile.rawDiff}\n${line}`;
354
368
  };
355
369
  for (const line of lines) parseLine(line);
356
370
  for (const file of files) {
@@ -1,4 +1,4 @@
1
- import { a as isFunction } from "./assertions-qMxfVhSu.mjs";
1
+ import { a as isFunction } from "./assertions-CsE3pD8P.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-B1mzA-Rz.mjs";
1
+ import { a as isPlainObject } from "./typeGuards-CMQqixVr.mjs";
2
2
  import { sortBy } from "./arrayUtils.mjs";
3
3
 
4
4
  //#region src/filterObjectOrArrayKeys.ts
@@ -0,0 +1,67 @@
1
+ import uFuzzy from "@leeoniya/ufuzzy";
2
+
3
+ //#region src/fuzzySearch.d.ts
4
+ type SearchOptions<T> = {
5
+ items: T[];
6
+ getStringToMatch: (item: T) => string;
7
+ searchQuery: string | null;
8
+ /** Pass a stable uFuzzy instance, you can use `getUFuzzyInstance` for this */
9
+ uFuzzy: uFuzzy;
10
+ ignoreBestMatch?: boolean;
11
+ throwOnError?: boolean;
12
+ };
13
+ /**
14
+ * Performs fuzzy search on a list of items and returns matched items with score
15
+ * metadata.
16
+ *
17
+ * Uses uFuzzy for efficient fuzzy matching with Latin character normalization.
18
+ * Falls back to simple string inclusion matching if an error occurs.
19
+ *
20
+ * @param options - Configuration options for the fuzzy search
21
+ * @param options.items - Array of items to search through
22
+ * @param options.getStringToMatch - Function that extracts the string to match
23
+ * from each item
24
+ * @param options.searchQuery - The search query string (null or empty string
25
+ * returns all items)
26
+ * @param options.uFuzzy - Configured uFuzzy instance (use `getUFuzzyInstance`
27
+ * to create one)
28
+ * @param options.ignoreBestMatch - If true, skips calculating the best match
29
+ * score for performance
30
+ * @param options.throwOnError - If true, throws errors instead of falling back
31
+ * to simple string matching
32
+ * @returns Object containing filtered/sorted items and the best match score
33
+ * (higher is better)
34
+ */
35
+ declare function fuzzySearchItemsWithResultMetadata<T>({
36
+ items,
37
+ searchQuery: _searchQuery,
38
+ getStringToMatch,
39
+ uFuzzy: uf,
40
+ ignoreBestMatch,
41
+ throwOnError
42
+ }: SearchOptions<T>): {
43
+ items: T[];
44
+ bestMatchScore: number;
45
+ };
46
+ /**
47
+ * Performs fuzzy search on a list of items and returns matched items.
48
+ *
49
+ * Simplified version of `fuzzySearchItemsWithResultMetadata` that only returns
50
+ * items.
51
+ */
52
+ declare function fuzzySearchItems<T>({
53
+ items,
54
+ searchQuery: _searchQuery,
55
+ getStringToMatch,
56
+ uFuzzy: uf
57
+ }: Omit<SearchOptions<T>, 'ignoreBestMatch'>): T[];
58
+ /**
59
+ * Creates a configured uFuzzy instance with custom sorting for optimal fuzzy
60
+ * matching.
61
+ *
62
+ * The instance uses intraMode=1 and custom sorting that prioritizes: contiguous
63
+ * character matches, prefix bounds, match density, and early start position.
64
+ */
65
+ declare function getUFuzzyInstance(): uFuzzy;
66
+ //#endregion
67
+ export { fuzzySearchItems, fuzzySearchItemsWithResultMetadata, getUFuzzyInstance };
@@ -0,0 +1,114 @@
1
+ import uFuzzy from "@leeoniya/ufuzzy";
2
+
3
+ //#region src/fuzzySearch.ts
4
+ /**
5
+ * Performs fuzzy search on a list of items and returns matched items with score
6
+ * metadata.
7
+ *
8
+ * Uses uFuzzy for efficient fuzzy matching with Latin character normalization.
9
+ * Falls back to simple string inclusion matching if an error occurs.
10
+ *
11
+ * @param options - Configuration options for the fuzzy search
12
+ * @param options.items - Array of items to search through
13
+ * @param options.getStringToMatch - Function that extracts the string to match
14
+ * from each item
15
+ * @param options.searchQuery - The search query string (null or empty string
16
+ * returns all items)
17
+ * @param options.uFuzzy - Configured uFuzzy instance (use `getUFuzzyInstance`
18
+ * to create one)
19
+ * @param options.ignoreBestMatch - If true, skips calculating the best match
20
+ * score for performance
21
+ * @param options.throwOnError - If true, throws errors instead of falling back
22
+ * to simple string matching
23
+ * @returns Object containing filtered/sorted items and the best match score
24
+ * (higher is better)
25
+ */
26
+ function fuzzySearchItemsWithResultMetadata({ items, searchQuery: _searchQuery, getStringToMatch, uFuzzy: uf, ignoreBestMatch, throwOnError }) {
27
+ const searchQuery = normalizeSearchQuery(_searchQuery ?? "");
28
+ if (!searchQuery) return {
29
+ items,
30
+ bestMatchScore: 0
31
+ };
32
+ try {
33
+ const searchStrings = items.map((item) => uFuzzy.latinize(getStringToMatch(item)));
34
+ let [filteredIndexes, info, orderedIndexes] = uf.search(searchStrings, searchQuery);
35
+ if (!filteredIndexes) filteredIndexes = [];
36
+ const sortedItems = [];
37
+ let bestMatchScore = void 0;
38
+ if (orderedIndexes) for (const filteredIndex of orderedIndexes) {
39
+ const index = filteredIndexes[filteredIndex];
40
+ const item = items[index];
41
+ if (item) {
42
+ if (!ignoreBestMatch && bestMatchScore === void 0 && info) {
43
+ const start = info.start[filteredIndex] ?? 0;
44
+ const chars = info.chars[filteredIndex] ?? 0;
45
+ const terms = info.terms[filteredIndex] ?? 0;
46
+ const inter = (info.interLft2[filteredIndex] ?? 0) + (info.interRgt2[filteredIndex] ?? 0);
47
+ bestMatchScore = 50 - start;
48
+ const intra = info.intraIns[filteredIndex] ?? 0;
49
+ const density = chars / (searchStrings[index]?.length ?? 0);
50
+ bestMatchScore += density * 10;
51
+ bestMatchScore += terms * 10;
52
+ bestMatchScore += inter * 10;
53
+ bestMatchScore += intra * 10;
54
+ }
55
+ sortedItems.push(item);
56
+ }
57
+ }
58
+ else for (const i of filteredIndexes) if (items[i]) sortedItems.push(items[i]);
59
+ return {
60
+ items: sortedItems,
61
+ bestMatchScore: bestMatchScore ?? 0
62
+ };
63
+ } catch (e) {
64
+ if (throwOnError) throw e;
65
+ console.error(e);
66
+ return {
67
+ items: items.filter((item) => getStringToMatch(item).includes(searchQuery)),
68
+ bestMatchScore: 0
69
+ };
70
+ }
71
+ }
72
+ /**
73
+ * Performs fuzzy search on a list of items and returns matched items.
74
+ *
75
+ * Simplified version of `fuzzySearchItemsWithResultMetadata` that only returns
76
+ * items.
77
+ */
78
+ function fuzzySearchItems({ items, searchQuery: _searchQuery, getStringToMatch, uFuzzy: uf }) {
79
+ return fuzzySearchItemsWithResultMetadata({
80
+ items,
81
+ searchQuery: _searchQuery,
82
+ getStringToMatch,
83
+ uFuzzy: uf,
84
+ ignoreBestMatch: true
85
+ }).items;
86
+ }
87
+ /**
88
+ * Creates a configured uFuzzy instance with custom sorting for optimal fuzzy
89
+ * matching.
90
+ *
91
+ * The instance uses intraMode=1 and custom sorting that prioritizes: contiguous
92
+ * character matches, prefix bounds, match density, and early start position.
93
+ */
94
+ function getUFuzzyInstance() {
95
+ return new uFuzzy({
96
+ intraMode: 1,
97
+ sort(info, haystack) {
98
+ const { idx, chars, terms, interLft2, interLft1, start, intraIns, interIns } = info;
99
+ return idx.map((_, i) => i).sort((ia, ib) => chars[ib] - chars[ia] || intraIns[ia] - intraIns[ib] || terms[ib] + interLft2[ib] + .5 * interLft1[ib] - (terms[ia] + interLft2[ia] + .5 * interLft1[ia]) || interIns[ia] - interIns[ib] || start[ia] - start[ib] || haystack[idx[ia]].length - haystack[idx[ib]].length || cmp(haystack[idx[ia]], haystack[idx[ib]]));
100
+ }
101
+ });
102
+ }
103
+ const cmp = new Intl.Collator("en", {
104
+ numeric: true,
105
+ sensitivity: "base"
106
+ }).compare;
107
+ function normalizeSearchQuery(searchQuery) {
108
+ let normalized = searchQuery.trim();
109
+ normalized = uFuzzy.latinize(normalized);
110
+ return normalized;
111
+ }
112
+
113
+ //#endregion
114
+ export { fuzzySearchItems, fuzzySearchItemsWithResultMetadata, getUFuzzyInstance };
@@ -1,4 +1,4 @@
1
- import { o as isObject } from "./assertions-qMxfVhSu.mjs";
1
+ import { o as isObject } from "./assertions-CsE3pD8P.mjs";
2
2
 
3
3
  //#region src/getCompositeKey.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
- import { i as invariant } from "./assertions-qMxfVhSu.mjs";
2
- import { a as clampRange, i as clampMin, r as clampMax } from "./mathUtils-BDP1lM_z.mjs";
1
+ import { i as invariant } from "./assertions-CsE3pD8P.mjs";
2
+ import { a as clampRange, i as clampMin, r as clampMax } from "./mathUtils-DuqyAkNL.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-C7EZEixx.mjs";
1
+ import { t as deepEqual } from "./deepEqual-2xhh-diQ.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-BDP1lM_z.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-DuqyAkNL.mjs";
2
2
 
3
3
  export { ceilToStep, clamp, clampMax, clampMin, clampRange, fixFloatingPointNumber, floorToStep, round, roundToStep };
@@ -1,4 +1,4 @@
1
- import { n as isFunction } from "./typeGuards-B1mzA-Rz.mjs";
1
+ import { n as isFunction } from "./typeGuards-CMQqixVr.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-Bb8drgKF.mjs";
2
+ import { d as typedObjectEntries } from "./typingFnUtils-BLxmDUp5.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-qMxfVhSu.mjs";
1
+ import { i as invariant, o as isObject } from "./assertions-CsE3pD8P.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-qMxfVhSu.mjs";
1
+ import { r as exhaustiveCheck } from "./assertions-CsE3pD8P.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-B1mzA-Rz.mjs";
1
+ import { s as isTruthy } from "./typeGuards-CMQqixVr.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-DjhWOiYn.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-DEEj_Z1p.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-B1mzA-Rz.mjs";
2
- import { o as isObject } from "./assertions-qMxfVhSu.mjs";
1
+ import { a as isPlainObject } from "./typeGuards-CMQqixVr.mjs";
2
+ import { o as isObject } from "./assertions-CsE3pD8P.mjs";
3
3
  import { arrayWithPrevAndIndex, filterAndMap } from "./arrayUtils.mjs";
4
4
  import { defer } from "./promiseUtils.mjs";
5
- import { i as clampMin } from "./mathUtils-BDP1lM_z.mjs";
6
- import { t as deepEqual } from "./deepEqual-C7EZEixx.mjs";
5
+ import { i as clampMin } from "./mathUtils-DuqyAkNL.mjs";
6
+ import { t as deepEqual } from "./deepEqual-2xhh-diQ.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-DfICShCc.mjs";
2
- import { r as clampMax } from "./mathUtils-BDP1lM_z.mjs";
1
+ import { t as castToNumber } from "./castValues-QQmtZf_x.mjs";
2
+ import { r as clampMax } from "./mathUtils-DuqyAkNL.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-sr2lhQRw.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-CJSFU8a1.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-qMxfVhSu.mjs";
1
+ import { a as isFunction, c as isPromise, o as isObject } from "./assertions-CsE3pD8P.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-B1mzA-Rz.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-CMQqixVr.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-Bb8drgKF.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-BLxmDUp5.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-B1mzA-Rz.mjs";
2
- import { C as truncateString } from "./stringUtils-DjhWOiYn.mjs";
3
- import { t as bytesToHumanReadable } from "./conversions-DTmwEMIu.mjs";
1
+ import { a as isPlainObject, i as isObject } from "./typeGuards-CMQqixVr.mjs";
2
+ import { C as truncateString } from "./stringUtils-DEEj_Z1p.mjs";
3
+ import { t as bytesToHumanReadable } from "./conversions-CWGUTE04.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.66.0",
4
+ "version": "3.68.0",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "dist",
@@ -35,6 +35,7 @@
35
35
  "./enhancedMap": "./dist/enhancedMap.mjs",
36
36
  "./exhaustiveMatch": "./dist/exhaustiveMatch.mjs",
37
37
  "./filterObjectOrArrayKeys": "./dist/filterObjectOrArrayKeys.mjs",
38
+ "./fuzzySearch": "./dist/fuzzySearch.mjs",
38
39
  "./getAutoIncrementId": "./dist/getAutoIncrementId.mjs",
39
40
  "./getCompositeKey": "./dist/getCompositeKey.mjs",
40
41
  "./getValueStableKey": "./dist/getValueStableKey.mjs",
@@ -95,8 +96,8 @@
95
96
  "mitata": "^1.0.32",
96
97
  "prettier": "3.4.2",
97
98
  "prettier-plugin-organize-imports": "^4.1.0",
98
- "tsm": "^2.3.0",
99
99
  "tsdown": "^0.18.2",
100
+ "tsm": "^2.3.0",
100
101
  "typedoc": "^0.28.4",
101
102
  "typedoc-plugin-markdown": "^4.6.3",
102
103
  "typedoc-plugin-missing-exports": "^4.0.0",
@@ -106,6 +107,7 @@
106
107
  "vitest": "^3.0.4"
107
108
  },
108
109
  "dependencies": {
110
+ "@leeoniya/ufuzzy": "^1.0.19",
109
111
  "evtmitter": "^1.0.2",
110
112
  "t-result": "^0.6.1"
111
113
  },