@ls-stack/utils 3.18.0 → 3.20.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/README.md +1 -15
- package/docs/README.md +72 -0
- package/docs/_media/modules.md +52 -0
- package/docs/arrayUtils/-internal-.md +17 -0
- package/docs/arrayUtils/README.md +423 -0
- package/docs/assertions/-internal-.md +63 -0
- package/docs/assertions/README.md +565 -0
- package/docs/asyncQueue/-internal-.md +815 -0
- package/docs/asyncQueue/README.md +75 -0
- package/docs/awaitDebounce.md +66 -0
- package/docs/cache/-internal-.md +168 -0
- package/docs/cache/README.md +360 -0
- package/docs/castValues.md +47 -0
- package/docs/concurrentCalls/-internal-.md +416 -0
- package/docs/concurrentCalls/README.md +77 -0
- package/docs/consoleFmt.md +91 -0
- package/docs/conversions.md +27 -0
- package/docs/createThrottleController/-internal-.md +73 -0
- package/docs/createThrottleController/README.md +31 -0
- package/docs/debounce.md +188 -0
- package/docs/dedent/-internal-.md +17 -0
- package/docs/dedent/README.md +204 -0
- package/docs/deepEqual.md +94 -0
- package/docs/enhancedMap.md +358 -0
- package/docs/exhaustiveMatch/-internal-.md +39 -0
- package/docs/exhaustiveMatch/README.md +146 -0
- package/docs/getAutoIncrementId.md +93 -0
- package/docs/getCompositeKey.md +39 -0
- package/docs/getValueStableKey.md +57 -0
- package/docs/hash.md +31 -0
- package/docs/interpolate/-internal-.md +61 -0
- package/docs/interpolate/README.md +62 -0
- package/docs/levenshtein.md +93 -0
- package/docs/main.md +21 -0
- package/docs/mathUtils.md +137 -0
- package/docs/modules.md +52 -0
- package/docs/objUtils.md +237 -0
- package/docs/parallelAsyncCalls/-internal-.md +347 -0
- package/docs/parallelAsyncCalls/README.md +45 -0
- package/docs/promiseUtils/-internal-.md +69 -0
- package/docs/promiseUtils/README.md +31 -0
- package/docs/retryOnError.md +67 -0
- package/docs/runShellCmd/-internal-.md +111 -0
- package/docs/runShellCmd/README.md +201 -0
- package/docs/safeJson.md +51 -0
- package/docs/saferTyping.md +228 -0
- package/docs/serializeXML.md +100 -0
- package/docs/shallowEqual.md +33 -0
- package/docs/sleep.md +27 -0
- package/docs/stringUtils/-internal-.md +17 -0
- package/docs/stringUtils/README.md +166 -0
- package/docs/testUtils.md +315 -0
- package/docs/throttle/-internal-.md +47 -0
- package/docs/throttle/README.md +178 -0
- package/docs/time.md +274 -0
- package/docs/timers.md +256 -0
- package/docs/tsResult/-internal-.md +327 -0
- package/docs/tsResult/README.md +696 -0
- package/docs/typeGuards.md +399 -0
- package/docs/typingFnUtils/-internal-.md +27 -0
- package/docs/typingFnUtils/README.md +293 -0
- package/docs/typingTestUtils.md +172 -0
- package/docs/typingUtils.md +111 -0
- package/docs/yamlStringify.md +45 -0
- package/lib/arrayUtils.js +3 -3
- package/lib/assertions.js +2 -2
- package/lib/awaitDebounce.cjs +106 -0
- package/lib/awaitDebounce.d.cts +38 -0
- package/lib/awaitDebounce.d.ts +38 -0
- package/lib/awaitDebounce.js +28 -0
- package/lib/cache.js +2 -2
- package/lib/{chunk-NH2LCAQS.js → chunk-6FIBVC2P.js} +1 -1
- package/lib/{chunk-GKOTKAIV.js → chunk-7CQPOM5I.js} +1 -1
- package/lib/{chunk-WS4WEVHU.js → chunk-C2SVCIWE.js} +1 -1
- package/lib/{chunk-SSKW673U.js → chunk-JF2MDHOJ.js} +5 -1
- package/lib/chunk-NW5H5EW7.js +100 -0
- package/lib/{chunk-DMW5Q4T2.js → chunk-SRVMMYSW.js} +1 -1
- package/lib/concurrentCalls.js +3 -3
- package/lib/createThrottleController.js +3 -3
- package/lib/debounce.js +4 -95
- package/lib/dedent.cjs +31 -3
- package/lib/dedent.d.cts +61 -1
- package/lib/dedent.d.ts +61 -1
- package/lib/dedent.js +31 -3
- package/lib/enhancedMap.js +3 -3
- package/lib/getAutoIncrementId.cjs +44 -0
- package/lib/getAutoIncrementId.d.cts +44 -0
- package/lib/getAutoIncrementId.d.ts +44 -0
- package/lib/getAutoIncrementId.js +18 -0
- package/lib/getCompositeKey.js +3 -3
- package/lib/getValueStableKey.js +3 -3
- package/lib/interpolate.js +2 -2
- package/lib/parallelAsyncCalls.js +2 -2
- package/lib/runShellCmd.d.cts +50 -0
- package/lib/runShellCmd.d.ts +50 -0
- package/lib/serializeXML.cjs +7 -2
- package/lib/serializeXML.d.cts +1 -1
- package/lib/serializeXML.d.ts +1 -1
- package/lib/serializeXML.js +7 -5
- package/lib/testUtils.js +3 -3
- package/lib/throttle.cjs +250 -0
- package/lib/throttle.d.cts +89 -0
- package/lib/throttle.d.ts +89 -0
- package/lib/throttle.js +38 -0
- package/lib/tsResult.js +2 -2
- package/lib/typeGuards.cjs +7 -2
- package/lib/typeGuards.d.cts +2 -1
- package/lib/typeGuards.d.ts +2 -1
- package/lib/typeGuards.js +5 -3
- package/lib/typingFnUtils.cjs +5 -1
- package/lib/typingFnUtils.d.cts +1 -1
- package/lib/typingFnUtils.d.ts +1 -1
- package/lib/typingFnUtils.js +5 -1
- package/lib/yamlStringify.js +5 -5
- package/package.json +22 -12
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { DebouncedFunc } from './debounce.js';
|
|
2
|
+
import { __LEGIT_ANY_FUNCTION__ } from './saferTyping.js';
|
|
3
|
+
|
|
4
|
+
interface ThrottleSettings {
|
|
5
|
+
/**
|
|
6
|
+
* Specify invoking on the leading edge of the timeout.
|
|
7
|
+
* @default true
|
|
8
|
+
*/
|
|
9
|
+
leading?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Specify invoking on the trailing edge of the timeout.
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
trailing?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a throttled function that only invokes the provided function at most once per every `wait` milliseconds.
|
|
18
|
+
* The throttled function comes with a `cancel` method to cancel delayed invocations and a `flush` method to immediately invoke them.
|
|
19
|
+
*
|
|
20
|
+
* Throttling is useful for rate-limiting events that fire frequently, like scroll or resize handlers.
|
|
21
|
+
* Unlike debouncing, throttling guarantees the function is called at regular intervals.
|
|
22
|
+
*
|
|
23
|
+
* @template T - The type of the function to throttle
|
|
24
|
+
* @param func - The function to throttle
|
|
25
|
+
* @param wait - The number of milliseconds to throttle invocations to
|
|
26
|
+
* @param options - The options object
|
|
27
|
+
* @param options.leading - Specify invoking on the leading edge of the timeout (default: true)
|
|
28
|
+
* @param options.trailing - Specify invoking on the trailing edge of the timeout (default: true)
|
|
29
|
+
* @returns Returns the new throttled function
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const throttledSave = throttle(saveData, 1000);
|
|
34
|
+
*
|
|
35
|
+
* // Will only call saveData at most once per second
|
|
36
|
+
* throttledSave();
|
|
37
|
+
* throttledSave();
|
|
38
|
+
* throttledSave();
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* // Only invoke on trailing edge
|
|
44
|
+
* const throttledHandler = throttle(handleScroll, 100, { leading: false });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare function throttle<T extends __LEGIT_ANY_FUNCTION__>(func: T, wait: number, options?: ThrottleSettings): DebouncedFunc<T>;
|
|
48
|
+
/**
|
|
49
|
+
* Creates a factory for throttled functions that caches throttled instances based on function arguments.
|
|
50
|
+
* Each unique set of arguments gets its own throttled function instance, allowing for fine-grained
|
|
51
|
+
* throttling control per argument combination.
|
|
52
|
+
*
|
|
53
|
+
* This is useful when you want to throttle calls to the same function but with different parameters
|
|
54
|
+
* independently. For example, throttling API calls per user ID or throttling UI updates per component.
|
|
55
|
+
*
|
|
56
|
+
* @template T - The type of arguments the callback function accepts
|
|
57
|
+
* @template R - The return type of the callback function
|
|
58
|
+
* @param wait - The number of milliseconds to throttle invocations to
|
|
59
|
+
* @param callback - The function to throttle
|
|
60
|
+
* @param options - The throttle options (leading/trailing behavior)
|
|
61
|
+
* @returns An object with a `call` method that accepts the callback arguments
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const apiThrottle = createThrottledFunctionFactory(
|
|
66
|
+
* 1000,
|
|
67
|
+
* (userId: string, action: string) => callAPI(userId, action)
|
|
68
|
+
* );
|
|
69
|
+
*
|
|
70
|
+
* // Each user gets their own throttled instance
|
|
71
|
+
* apiThrottle.call('user1', 'update'); // Executes immediately
|
|
72
|
+
* apiThrottle.call('user2', 'update'); // Executes immediately (different user)
|
|
73
|
+
* apiThrottle.call('user1', 'update'); // Throttled (same user)
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* // Throttle UI updates per component
|
|
79
|
+
* const updateThrottle = createThrottledFunctionFactory(
|
|
80
|
+
* 100,
|
|
81
|
+
* (componentId: string, data: any) => updateComponent(componentId, data)
|
|
82
|
+
* );
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
declare function createThrottledFunctionFactory<T extends string | number | null | undefined | boolean, R>(wait: number, callback: (...args: T[]) => R, options?: ThrottleSettings): {
|
|
86
|
+
call: (...args: T[]) => R | undefined;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export { createThrottledFunctionFactory, throttle };
|
package/lib/throttle.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
debounce
|
|
3
|
+
} from "./chunk-NW5H5EW7.js";
|
|
4
|
+
import {
|
|
5
|
+
EnhancedMap
|
|
6
|
+
} from "./chunk-7CQPOM5I.js";
|
|
7
|
+
import "./chunk-C2SVCIWE.js";
|
|
8
|
+
import "./chunk-JF2MDHOJ.js";
|
|
9
|
+
|
|
10
|
+
// src/throttle.ts
|
|
11
|
+
function throttle(func, wait, options) {
|
|
12
|
+
let leading = true;
|
|
13
|
+
let trailing = true;
|
|
14
|
+
if (options) {
|
|
15
|
+
leading = "leading" in options ? !!options.leading : leading;
|
|
16
|
+
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
17
|
+
}
|
|
18
|
+
return debounce(func, wait, { leading, maxWait: wait, trailing });
|
|
19
|
+
}
|
|
20
|
+
function createThrottledFunctionFactory(wait, callback, options) {
|
|
21
|
+
const cache = new EnhancedMap();
|
|
22
|
+
return {
|
|
23
|
+
call: (...args) => {
|
|
24
|
+
const key = args.map(
|
|
25
|
+
(arg) => arg === void 0 ? "__UNDEFINED__" : JSON.stringify(arg)
|
|
26
|
+
).join(",");
|
|
27
|
+
const cachedFunction = cache.getOrInsert(
|
|
28
|
+
key,
|
|
29
|
+
() => throttle(callback, wait, options)
|
|
30
|
+
);
|
|
31
|
+
return cachedFunction(...args);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
createThrottledFunctionFactory,
|
|
37
|
+
throttle
|
|
38
|
+
};
|
package/lib/tsResult.js
CHANGED
package/lib/typeGuards.cjs
CHANGED
|
@@ -25,7 +25,8 @@ __export(typeGuards_exports, {
|
|
|
25
25
|
isNonEmptyArray: () => isNonEmptyArray,
|
|
26
26
|
isObject: () => isObject,
|
|
27
27
|
isPlainObject: () => isPlainObject,
|
|
28
|
-
isPromise: () => isPromise
|
|
28
|
+
isPromise: () => isPromise,
|
|
29
|
+
isTruthy: () => isTruthy
|
|
29
30
|
});
|
|
30
31
|
module.exports = __toCommonJS(typeGuards_exports);
|
|
31
32
|
function isObject(value) {
|
|
@@ -54,6 +55,9 @@ function isNonEmptyArray(value) {
|
|
|
54
55
|
function arrayHasAtLeastXItems(array, minLength) {
|
|
55
56
|
return array.length >= minLength;
|
|
56
57
|
}
|
|
58
|
+
function isTruthy(value) {
|
|
59
|
+
return !!value;
|
|
60
|
+
}
|
|
57
61
|
// Annotate the CommonJS export names for ESM import in node:
|
|
58
62
|
0 && (module.exports = {
|
|
59
63
|
arrayHasAtLeastXItems,
|
|
@@ -61,5 +65,6 @@ function arrayHasAtLeastXItems(array, minLength) {
|
|
|
61
65
|
isNonEmptyArray,
|
|
62
66
|
isObject,
|
|
63
67
|
isPlainObject,
|
|
64
|
-
isPromise
|
|
68
|
+
isPromise,
|
|
69
|
+
isTruthy
|
|
65
70
|
});
|
package/lib/typeGuards.d.cts
CHANGED
|
@@ -105,5 +105,6 @@ declare function arrayHasAtLeastXItems<T>(array: T[], minLength: 2): array is [T
|
|
|
105
105
|
declare function arrayHasAtLeastXItems<T>(array: T[], minLength: 3): array is [T, T, T, ...T[]];
|
|
106
106
|
declare function arrayHasAtLeastXItems<T>(array: T[], minLength: 4): array is [T, T, T, T, ...T[]];
|
|
107
107
|
declare function arrayHasAtLeastXItems<T>(array: T[], minLength: 5): array is [T, T, T, T, T, ...T[]];
|
|
108
|
+
declare function isTruthy<T>(value: T): value is Exclude<T, null | undefined | false | 0 | '' | 0n>;
|
|
108
109
|
|
|
109
|
-
export { type NonEmptyArray, arrayHasAtLeastXItems, isFunction, isNonEmptyArray, isObject, isPlainObject, isPromise };
|
|
110
|
+
export { type NonEmptyArray, arrayHasAtLeastXItems, isFunction, isNonEmptyArray, isObject, isPlainObject, isPromise, isTruthy };
|
package/lib/typeGuards.d.ts
CHANGED
|
@@ -105,5 +105,6 @@ declare function arrayHasAtLeastXItems<T>(array: T[], minLength: 2): array is [T
|
|
|
105
105
|
declare function arrayHasAtLeastXItems<T>(array: T[], minLength: 3): array is [T, T, T, ...T[]];
|
|
106
106
|
declare function arrayHasAtLeastXItems<T>(array: T[], minLength: 4): array is [T, T, T, T, ...T[]];
|
|
107
107
|
declare function arrayHasAtLeastXItems<T>(array: T[], minLength: 5): array is [T, T, T, T, T, ...T[]];
|
|
108
|
+
declare function isTruthy<T>(value: T): value is Exclude<T, null | undefined | false | 0 | '' | 0n>;
|
|
108
109
|
|
|
109
|
-
export { type NonEmptyArray, arrayHasAtLeastXItems, isFunction, isNonEmptyArray, isObject, isPlainObject, isPromise };
|
|
110
|
+
export { type NonEmptyArray, arrayHasAtLeastXItems, isFunction, isNonEmptyArray, isObject, isPlainObject, isPromise, isTruthy };
|
package/lib/typeGuards.js
CHANGED
|
@@ -4,13 +4,15 @@ import {
|
|
|
4
4
|
isNonEmptyArray,
|
|
5
5
|
isObject,
|
|
6
6
|
isPlainObject,
|
|
7
|
-
isPromise
|
|
8
|
-
|
|
7
|
+
isPromise,
|
|
8
|
+
isTruthy
|
|
9
|
+
} from "./chunk-JF2MDHOJ.js";
|
|
9
10
|
export {
|
|
10
11
|
arrayHasAtLeastXItems,
|
|
11
12
|
isFunction,
|
|
12
13
|
isNonEmptyArray,
|
|
13
14
|
isObject,
|
|
14
15
|
isPlainObject,
|
|
15
|
-
isPromise
|
|
16
|
+
isPromise,
|
|
17
|
+
isTruthy
|
|
16
18
|
};
|
package/lib/typingFnUtils.cjs
CHANGED
|
@@ -44,7 +44,11 @@ function asType(value) {
|
|
|
44
44
|
return value;
|
|
45
45
|
}
|
|
46
46
|
function narrowStringToUnion(key, union) {
|
|
47
|
-
if (key
|
|
47
|
+
if (!key) return void 0;
|
|
48
|
+
if (union instanceof Set) {
|
|
49
|
+
return union.has(key) ? key : void 0;
|
|
50
|
+
}
|
|
51
|
+
if (union.includes(key)) {
|
|
48
52
|
return key;
|
|
49
53
|
}
|
|
50
54
|
return void 0;
|
package/lib/typingFnUtils.d.cts
CHANGED
|
@@ -10,7 +10,7 @@ declare function typedObjectKeys<T extends Record<string, unknown>>(obj: T): (ke
|
|
|
10
10
|
/** a safe way to cast types, use to substitute the `as Type` */
|
|
11
11
|
declare function asType<T = unknown>(value: T): T;
|
|
12
12
|
/** narrow a string to a union of strings */
|
|
13
|
-
declare function narrowStringToUnion<const T extends string>(key: string | undefined | null, union: T[]): T | undefined;
|
|
13
|
+
declare function narrowStringToUnion<const T extends string>(key: string | undefined | null, union: T[] | readonly T[] | Set<T>): T | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* Type helper to check if a type is a subtype of another type.
|
|
16
16
|
*
|
package/lib/typingFnUtils.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare function typedObjectKeys<T extends Record<string, unknown>>(obj: T): (ke
|
|
|
10
10
|
/** a safe way to cast types, use to substitute the `as Type` */
|
|
11
11
|
declare function asType<T = unknown>(value: T): T;
|
|
12
12
|
/** narrow a string to a union of strings */
|
|
13
|
-
declare function narrowStringToUnion<const T extends string>(key: string | undefined | null, union: T[]): T | undefined;
|
|
13
|
+
declare function narrowStringToUnion<const T extends string>(key: string | undefined | null, union: T[] | readonly T[] | Set<T>): T | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* Type helper to check if a type is a subtype of another type.
|
|
16
16
|
*
|
package/lib/typingFnUtils.js
CHANGED
|
@@ -12,7 +12,11 @@ function asType(value) {
|
|
|
12
12
|
return value;
|
|
13
13
|
}
|
|
14
14
|
function narrowStringToUnion(key, union) {
|
|
15
|
-
if (key
|
|
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)) {
|
|
16
20
|
return key;
|
|
17
21
|
}
|
|
18
22
|
return void 0;
|
package/lib/yamlStringify.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
bytesToHumanReadable
|
|
3
|
+
} from "./chunk-IATIXMCE.js";
|
|
1
4
|
import {
|
|
2
5
|
truncateString
|
|
3
6
|
} from "./chunk-4REIIZQY.js";
|
|
4
7
|
import {
|
|
5
8
|
isObject,
|
|
6
9
|
isPlainObject
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
bytesToHumanReadable
|
|
11
|
-
} from "./chunk-IATIXMCE.js";
|
|
10
|
+
} from "./chunk-C2SVCIWE.js";
|
|
11
|
+
import "./chunk-JF2MDHOJ.js";
|
|
12
12
|
|
|
13
13
|
// src/yamlStringify.ts
|
|
14
14
|
function yamlStringify(obj, {
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ls-stack/utils",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "3.
|
|
3
|
+
"description": "Universal TypeScript utilities for browser and Node.js",
|
|
4
|
+
"version": "3.20.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
|
-
"lib"
|
|
7
|
+
"lib",
|
|
8
|
+
"docs"
|
|
8
9
|
],
|
|
9
10
|
"repository": "github:lucasols/utils",
|
|
11
|
+
"homepage": "https://github.com/lucasols/utils/tree/main/packages/utils",
|
|
10
12
|
"author": "Lucas Santos",
|
|
11
13
|
"type": "module",
|
|
12
14
|
"sideEffects": false,
|
|
@@ -34,6 +36,10 @@
|
|
|
34
36
|
"import": "./lib/asyncQueue.js",
|
|
35
37
|
"require": "./lib/asyncQueue.cjs"
|
|
36
38
|
},
|
|
39
|
+
"./awaitDebounce": {
|
|
40
|
+
"import": "./lib/awaitDebounce.js",
|
|
41
|
+
"require": "./lib/awaitDebounce.cjs"
|
|
42
|
+
},
|
|
37
43
|
"./cache": {
|
|
38
44
|
"import": "./lib/cache.js",
|
|
39
45
|
"require": "./lib/cache.cjs"
|
|
@@ -78,6 +84,10 @@
|
|
|
78
84
|
"import": "./lib/exhaustiveMatch.js",
|
|
79
85
|
"require": "./lib/exhaustiveMatch.cjs"
|
|
80
86
|
},
|
|
87
|
+
"./getAutoIncrementId": {
|
|
88
|
+
"import": "./lib/getAutoIncrementId.js",
|
|
89
|
+
"require": "./lib/getAutoIncrementId.cjs"
|
|
90
|
+
},
|
|
81
91
|
"./getCompositeKey": {
|
|
82
92
|
"import": "./lib/getCompositeKey.js",
|
|
83
93
|
"require": "./lib/getCompositeKey.cjs"
|
|
@@ -150,6 +160,10 @@
|
|
|
150
160
|
"import": "./lib/testUtils.js",
|
|
151
161
|
"require": "./lib/testUtils.cjs"
|
|
152
162
|
},
|
|
163
|
+
"./throttle": {
|
|
164
|
+
"import": "./lib/throttle.js",
|
|
165
|
+
"require": "./lib/throttle.cjs"
|
|
166
|
+
},
|
|
153
167
|
"./time": {
|
|
154
168
|
"import": "./lib/time.js",
|
|
155
169
|
"require": "./lib/time.cjs"
|
|
@@ -187,6 +201,7 @@
|
|
|
187
201
|
"node": ">=20.0.0"
|
|
188
202
|
},
|
|
189
203
|
"devDependencies": {
|
|
204
|
+
"@eslint/js": "^9.18.0",
|
|
190
205
|
"@ls-stack/extended-lint": "^0.20.1",
|
|
191
206
|
"@types/eslint": "^9.6.1",
|
|
192
207
|
"@types/eslint__js": "^8.42.3",
|
|
@@ -221,16 +236,11 @@
|
|
|
221
236
|
"lint": "pnpm tsc && pnpm eslint",
|
|
222
237
|
"tsc": "tsc -p tsconfig.prod.json",
|
|
223
238
|
"tsc:watch": "tsc -p tsconfig.prod.json --watch",
|
|
224
|
-
"eslint": "CI=true eslint src/
|
|
225
|
-
"
|
|
226
|
-
"build
|
|
227
|
-
"build:update-exports": "tsm --no-warnings scripts/updatePackageExports.ts",
|
|
228
|
-
"build-test": "tsup --config tsup.test.config.ts",
|
|
229
|
-
"pre-publish": "./scripts/check-if-is-sync.sh && pnpm build",
|
|
230
|
-
"test:console-fmt": "tsm --no-warnings scripts/testConsoleFmt.ts",
|
|
239
|
+
"eslint": "CI=true eslint src/ --color --max-warnings=0 --fix",
|
|
240
|
+
"format": "prettier --write .",
|
|
241
|
+
"build": "tsup",
|
|
231
242
|
"bench:deepEqual": "tsm --no-warnings benchmarks/deepEqual.ts",
|
|
232
243
|
"docs": "typedoc",
|
|
233
|
-
"docs:watch": "typedoc --watch"
|
|
234
|
-
"docs:commit": "git add docs && git diff --cached --quiet docs || git commit -m 'docs: update docs'"
|
|
244
|
+
"docs:watch": "typedoc --watch"
|
|
235
245
|
}
|
|
236
246
|
}
|