@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.
- package/dist/arrayUtils.mjs +1 -1
- package/dist/{assertions-qMxfVhSu.mjs → assertions-CsE3pD8P.mjs} +1 -1
- package/dist/assertions.mjs +1 -1
- package/dist/asyncQueue.mjs +1 -1
- package/dist/cache.mjs +2 -2
- package/dist/castValues.mjs +1 -1
- package/dist/concurrentCalls.mjs +3 -3
- package/dist/conversions.mjs +1 -1
- package/dist/createThrottleController.mjs +1 -1
- package/dist/deepEqual.mjs +1 -1
- package/dist/deepReplaceValues.mjs +1 -1
- package/dist/diffParser.d.mts +16 -0
- package/dist/diffParser.mjs +15 -1
- package/dist/enhancedMap.mjs +1 -1
- package/dist/filterObjectOrArrayKeys.mjs +1 -1
- package/dist/fuzzySearch.d.mts +67 -0
- package/dist/fuzzySearch.mjs +114 -0
- package/dist/getCompositeKey.mjs +1 -1
- package/dist/interpolate.mjs +2 -2
- package/dist/keepPrevIfUnchanged.mjs +1 -1
- package/dist/mathUtils.mjs +1 -1
- package/dist/mutationUtils.mjs +1 -1
- package/dist/objUtils.mjs +1 -1
- package/dist/parallelAsyncCalls.mjs +1 -1
- package/dist/partialEqual.mjs +1 -1
- package/dist/serializeXML.mjs +1 -1
- package/dist/stringUtils.mjs +1 -1
- package/dist/testUtils.mjs +4 -4
- package/dist/{time-sr2lhQRw.mjs → time-CJSFU8a1.mjs} +2 -2
- package/dist/time.mjs +1 -1
- package/dist/tsResult.mjs +1 -1
- package/dist/typeGuards.mjs +1 -1
- package/dist/typingFnUtils.mjs +1 -1
- package/dist/yamlStringify.mjs +3 -3
- package/package.json +4 -2
- /package/dist/{castValues-DfICShCc.mjs → castValues-QQmtZf_x.mjs} +0 -0
- /package/dist/{conversions-DTmwEMIu.mjs → conversions-CWGUTE04.mjs} +0 -0
- /package/dist/{deepEqual-C7EZEixx.mjs → deepEqual-2xhh-diQ.mjs} +0 -0
- /package/dist/{mathUtils-BDP1lM_z.mjs → mathUtils-DuqyAkNL.mjs} +0 -0
- /package/dist/{stringUtils-DjhWOiYn.mjs → stringUtils-DEEj_Z1p.mjs} +0 -0
- /package/dist/{typeGuards-B1mzA-Rz.mjs → typeGuards-CMQqixVr.mjs} +0 -0
- /package/dist/{typingFnUtils-Bb8drgKF.mjs → typingFnUtils-BLxmDUp5.mjs} +0 -0
package/dist/arrayUtils.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as isPlainObject$1, i as isObject$1, n as isFunction$1, o as isPromise$1 } from "./typeGuards-
|
|
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";
|
package/dist/assertions.mjs
CHANGED
|
@@ -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-
|
|
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 };
|
package/dist/asyncQueue.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defer } from "./promiseUtils.mjs";
|
|
2
|
-
import { p as durationObjToMs } from "./time-
|
|
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-
|
|
2
|
-
import { p as durationObjToMs } from "./time-
|
|
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
|
/**
|
package/dist/castValues.mjs
CHANGED
package/dist/concurrentCalls.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as isObject, o as isPromise } from "./typeGuards-
|
|
2
|
-
import { i as invariant } from "./assertions-
|
|
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-
|
|
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
|
package/dist/conversions.mjs
CHANGED
package/dist/deepEqual.mjs
CHANGED
package/dist/diffParser.d.mts
CHANGED
|
@@ -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 };
|
package/dist/diffParser.mjs
CHANGED
|
@@ -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) {
|
package/dist/enhancedMap.mjs
CHANGED
|
@@ -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 };
|
package/dist/getCompositeKey.mjs
CHANGED
package/dist/interpolate.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as invariant } from "./assertions-
|
|
2
|
-
import { a as clampRange, i as clampMin, r as clampMax } from "./mathUtils-
|
|
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) {
|
package/dist/mathUtils.mjs
CHANGED
|
@@ -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-
|
|
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 };
|
package/dist/mutationUtils.mjs
CHANGED
package/dist/objUtils.mjs
CHANGED
package/dist/partialEqual.mjs
CHANGED
package/dist/serializeXML.mjs
CHANGED
package/dist/stringUtils.mjs
CHANGED
|
@@ -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-
|
|
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 };
|
package/dist/testUtils.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as isPlainObject } from "./typeGuards-
|
|
2
|
-
import { o as isObject } from "./assertions-
|
|
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-
|
|
6
|
-
import { t as deepEqual } from "./deepEqual-
|
|
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-
|
|
2
|
-
import { r as clampMax } from "./mathUtils-
|
|
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-
|
|
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
package/dist/typeGuards.mjs
CHANGED
|
@@ -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-
|
|
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 };
|
package/dist/typingFnUtils.mjs
CHANGED
|
@@ -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-
|
|
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 };
|
package/dist/yamlStringify.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as isPlainObject, i as isObject } from "./typeGuards-
|
|
2
|
-
import { C as truncateString } from "./stringUtils-
|
|
3
|
-
import { t as bytesToHumanReadable } from "./conversions-
|
|
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.
|
|
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
|
},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|