@andrew_l/toolkit 0.2.20 → 0.3.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/index.cjs +683 -616
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -7
- package/dist/index.d.mts +25 -7
- package/dist/index.d.ts +25 -7
- package/dist/index.mjs +682 -617
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
package/dist/index.d.cts
CHANGED
|
@@ -1378,7 +1378,16 @@ declare class LruCache<TKey = any, TValue = any> {
|
|
|
1378
1378
|
* @return {IterableIterator<[TKey, TValue | undefined]>}
|
|
1379
1379
|
*/
|
|
1380
1380
|
entries(): {
|
|
1381
|
-
[Symbol.iterator]():
|
|
1381
|
+
[Symbol.iterator](): {
|
|
1382
|
+
[Symbol.iterator](): /*elided*/ any;
|
|
1383
|
+
next(): {
|
|
1384
|
+
done: boolean;
|
|
1385
|
+
value: undefined;
|
|
1386
|
+
} | {
|
|
1387
|
+
done: boolean;
|
|
1388
|
+
value: (TKey | TValue | undefined)[];
|
|
1389
|
+
};
|
|
1390
|
+
};
|
|
1382
1391
|
next(): {
|
|
1383
1392
|
done: boolean;
|
|
1384
1393
|
value: undefined;
|
|
@@ -1394,7 +1403,7 @@ declare class LruCache<TKey = any, TValue = any> {
|
|
|
1394
1403
|
*/
|
|
1395
1404
|
splayOnTop(pointer: number): this;
|
|
1396
1405
|
[Symbol.iterator](): {
|
|
1397
|
-
[Symbol.iterator](): any;
|
|
1406
|
+
[Symbol.iterator](): /*elided*/ any;
|
|
1398
1407
|
next(): {
|
|
1399
1408
|
done: boolean;
|
|
1400
1409
|
value: undefined;
|
|
@@ -1911,7 +1920,7 @@ declare const ColorParser: {
|
|
|
1911
1920
|
* Calculate crc32 hash from string
|
|
1912
1921
|
* @group Crypto
|
|
1913
1922
|
*/
|
|
1914
|
-
declare function crc32(
|
|
1923
|
+
declare function crc32(value: Uint8Array | Uint8Array[] | string, seed?: number): number;
|
|
1915
1924
|
|
|
1916
1925
|
type DateObjectInput = Date | string | number | DateObject;
|
|
1917
1926
|
declare function createDateObject(value: DateObjectInput): DateObject;
|
|
@@ -3107,9 +3116,14 @@ type RetryOnErrorConfig = {
|
|
|
3107
3116
|
*/
|
|
3108
3117
|
shouldRetryBasedOnError?: (error: unknown, attempt: number) => boolean;
|
|
3109
3118
|
/**
|
|
3110
|
-
* Number of
|
|
3119
|
+
* Number of attempts to execute a function
|
|
3120
|
+
*/
|
|
3121
|
+
maxAttempts?: number;
|
|
3122
|
+
/**
|
|
3123
|
+
* Number of retries until the execution fails (initial + retries)
|
|
3124
|
+
* @deprecated use `maxAttempts`
|
|
3111
3125
|
*/
|
|
3112
|
-
maxRetriesNumber
|
|
3126
|
+
maxRetriesNumber?: number;
|
|
3113
3127
|
/**
|
|
3114
3128
|
* Delay multiply factor
|
|
3115
3129
|
*/
|
|
@@ -3143,7 +3157,7 @@ type RetryOnErrorConfig = {
|
|
|
3143
3157
|
*
|
|
3144
3158
|
* @group Utility Functions
|
|
3145
3159
|
*/
|
|
3146
|
-
declare function retryOnError<T extends AnyFunction>({ beforeRetryCallback, shouldRetryBasedOnError, maxRetriesNumber, delayFactor, delayMaxMs, delayMinMs, }: RetryOnErrorConfig, fn: T): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>;
|
|
3160
|
+
declare function retryOnError<T extends AnyFunction>({ beforeRetryCallback, shouldRetryBasedOnError, maxAttempts, maxRetriesNumber, delayFactor, delayMaxMs, delayMinMs, }: RetryOnErrorConfig, fn: T): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>;
|
|
3147
3161
|
|
|
3148
3162
|
interface ThrottleOptions {
|
|
3149
3163
|
/**
|
|
@@ -5062,6 +5076,7 @@ declare class ResourcePool<T = unknown> extends SimpleEventEmitter<ResourcePoolE
|
|
|
5062
5076
|
*/
|
|
5063
5077
|
destroy(rejectAcquires?: boolean): Promise<void>;
|
|
5064
5078
|
private tryGetAvailableResource;
|
|
5079
|
+
private isLimitReached;
|
|
5065
5080
|
private tryCreateAutoResource;
|
|
5066
5081
|
private enqueueAcquireRequest;
|
|
5067
5082
|
private moveResourceToAvailable;
|
|
@@ -5579,6 +5594,9 @@ declare const startCase: (value?: string) => string;
|
|
|
5579
5594
|
*/
|
|
5580
5595
|
declare function strAssign<T extends object>(str: string, obj: T, method?: (obj: T, key: string) => any): string;
|
|
5581
5596
|
|
|
5597
|
+
declare var textEncoder: TextEncoder;
|
|
5598
|
+
declare var textDecoder: TextDecoder;
|
|
5599
|
+
|
|
5582
5600
|
/**
|
|
5583
5601
|
* Truncates a string to the specified maximum length while preserving whole words
|
|
5584
5602
|
* and appends ellipsis (`...`) if the string exceeds the maximum length.
|
|
@@ -5644,4 +5662,4 @@ declare function wrapText(value: string, maxLength?: number): string;
|
|
|
5644
5662
|
*/
|
|
5645
5663
|
declare function toError<T>(value: T, unknownMessage?: string): T extends Error ? T : Error;
|
|
5646
5664
|
|
|
5647
|
-
export { type AnyFunction, AppError, type AppErrorOptions, type ArgumentsType, type Arrayable, AsyncIterableQueue, type Awaitable, type Base64ToBytesOptions, type BaseX, BrowserAssertionError, type BytesToBase64Options, CancellablePromise, type CatchErrorResult, Color, type ColorChannels, ColorParser, type Data, type DateObject, type DateObjectInput, type DebouncedFunction, type DeepPartial, type DeepReadonly, type Defer, instance as EJSON, EJSON as EJSONInstance, EJSONStream, type EJSONStreamOptions, type EJSONStreamOptionsWithPayload, type EJSONType, type EnvParser, type ExecResult, type ExecResultToSkip, type ExecResultToSuccess, type ExecSkip, type ExecSuccess, FindMean, FixedMap, FixedWeakMap, type Fn, type FormatMoney, type FormatNumber, type FunctionArgs, type GenericObject, type IfAny, type IsAny, type LiteralUnion, type Logger, LruCache, type Nothing, type OverwriteWith, type Prettify, type Primitive, type PromisifyFn, Queue, type RandomizerOptions, ResourcePool, type ResourcePoolEventMap, type ResourcePoolOptions, type RetryOnErrorConfig, type SecureCustomizerOptions, type SelectOptionItem, type SelectOptions, type SimpleDefaultEventMap, SimpleEventEmitter, type SimpleEventMap, SortedArray, type SortedArrayCompareFn, _default as TWEMOJI_REGEX, type ThemeConfig, type ThrottledFunction, TimeBucket, type TimeBucketOptions, type TimeObject, type TimeObjectInput, TimeSpan, type TimeSpanUnit, type TimeString, type TimeValue, type TimestampMsInput, type TypeOf, type TypeOfMap, type ValuesOfObject, type WithCache, type WithCacheBucketBatchOptions, type WithCacheBucketOptions, type WithCacheFixedOptions, type WithCacheLruOptions, type WithCacheOptions, type WithCachePointer, type WithCacheResult, type WithCacheStorage, type WithCustomizer, type WithCustomizerFactory, type WithCustomizerValue, type WrrItem, alpha, arrayable, assert, asyncFilter, asyncFind, asyncForEach, asyncMap, avg, avgCircular, base62, base62Fast, base64, base64ToBytes, base64url, basex, bigIntBytes, bigIntFromBytes, blendColors, buildCssColor, bytesToBase64, cache, cacheBucket, cacheFixed, cacheLRU, camelCase, capitalize, captureStackTrace, catchError, channelsToHSL, channelsToHex, channelsToRGB, checkBitmask, chunk, chunkSeries, clamp, cleanEmpty, cleanObject, colorToChannels, compareBytes, concatenateBytes, contrastRatio, convertToUnit, crc32, createCustomizer, createCustomizerFactory, createDateObject, createDeepCloneWith, createEJSON, createEJSONStream, createEnvParser, createRandomizer, createSecureCustomizer, createTimeObject, createTimeSpan, createWithCache, cssVariable, dateInDays, dateInSeconds, debounce, deepAssign, deepClone, deepCloneWith, deepDefaults, deepFreeze, def, defer, delay, difference, dropCache, env, escapeHtml, escapeNumeric, escapeRegExp, fastIdle, fastIdlePromise, fastRaf, findMean, flagsToMap, flatten, formatMoney, formatNumber, get, getFileExtension, getFileName, getInitials, getMostSpecificPaths, getRandomInt, getRandomTime, getWords, groupBy, has, hasOwn, hasProtocol, hex, hexToChannels, hmToSeconds, hslToChannels, humanFileSize, humanize, interpolateColor, intersection, isBigInt, isBoolean, isCached, isClient, isColorChannels, isCustomizerFactory, isDate, isDateObject, isDef, isEmpty, isEqual, isError, isFunction, isInfinity, isMap, isNullOrUndefined, isNumber, isObject, isOneEmoji, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isSkip, isString, isSuccess, isSymbol, isTimeObject, isTimeString, isTimeValue, isValidWeekDay, isWeakMap, isWeakSet, isWithCache, isoToFlagEmoji, kebabCase, keyBy, logger, loggerSetLevel, lowerCase, luminance, maskingEmail, maskingPhone, maskingWords, nextTickIteration, noop, objectId, omit, omitPrefixed, orderBy, parseAllNumbers, parseAlpha, parsePercentage, percentOf, pick, pickPrefixed, qs, rafPromise, randomString, removeVS16s, retryOnError, rgbToChannels, round2digits, secondsToHm, set, shuffle, snakeCase, sprintf, startCase, strAssign, sum, throttle, timeFromMinutes, timeStringify, timeToMinutes, timeout, timestamp, timestampMs, timestampToDate, tintedTextColor, toError, toMap, truncate, typeOf, uint16ToUint8, uint32ToUint8, uint8ToUint16, uint8ToUint32, unflatten, union, uniq, uniqBy, unset, weeksInYear, weightedRoundRobin, withCache, withCacheBucket, withCacheBucketBatch, withCacheFixed, withCacheLRU, withDeepClone, withPointerCache, wrapText };
|
|
5665
|
+
export { type AnyFunction, AppError, type AppErrorOptions, type ArgumentsType, type Arrayable, AsyncIterableQueue, type Awaitable, type Base64ToBytesOptions, type BaseX, BrowserAssertionError, type BytesToBase64Options, CancellablePromise, type CatchErrorResult, Color, type ColorChannels, ColorParser, type Data, type DateObject, type DateObjectInput, type DebouncedFunction, type DeepPartial, type DeepReadonly, type Defer, instance as EJSON, EJSON as EJSONInstance, EJSONStream, type EJSONStreamOptions, type EJSONStreamOptionsWithPayload, type EJSONType, type EnvParser, type ExecResult, type ExecResultToSkip, type ExecResultToSuccess, type ExecSkip, type ExecSuccess, FindMean, FixedMap, FixedWeakMap, type Fn, type FormatMoney, type FormatNumber, type FunctionArgs, type GenericObject, type IfAny, type IsAny, type LiteralUnion, type Logger, LruCache, type Nothing, type OverwriteWith, type Prettify, type Primitive, type PromisifyFn, Queue, type RandomizerOptions, ResourcePool, type ResourcePoolEventMap, type ResourcePoolOptions, type RetryOnErrorConfig, type SecureCustomizerOptions, type SelectOptionItem, type SelectOptions, type SimpleDefaultEventMap, SimpleEventEmitter, type SimpleEventMap, SortedArray, type SortedArrayCompareFn, _default as TWEMOJI_REGEX, type ThemeConfig, type ThrottledFunction, TimeBucket, type TimeBucketOptions, type TimeObject, type TimeObjectInput, TimeSpan, type TimeSpanUnit, type TimeString, type TimeValue, type TimestampMsInput, type TypeOf, type TypeOfMap, type ValuesOfObject, type WithCache, type WithCacheBucketBatchOptions, type WithCacheBucketOptions, type WithCacheFixedOptions, type WithCacheLruOptions, type WithCacheOptions, type WithCachePointer, type WithCacheResult, type WithCacheStorage, type WithCustomizer, type WithCustomizerFactory, type WithCustomizerValue, type WrrItem, alpha, arrayable, assert, asyncFilter, asyncFind, asyncForEach, asyncMap, avg, avgCircular, base62, base62Fast, base64, base64ToBytes, base64url, basex, bigIntBytes, bigIntFromBytes, blendColors, buildCssColor, bytesToBase64, cache, cacheBucket, cacheFixed, cacheLRU, camelCase, capitalize, captureStackTrace, catchError, channelsToHSL, channelsToHex, channelsToRGB, checkBitmask, chunk, chunkSeries, clamp, cleanEmpty, cleanObject, colorToChannels, compareBytes, concatenateBytes, contrastRatio, convertToUnit, crc32, createCustomizer, createCustomizerFactory, createDateObject, createDeepCloneWith, createEJSON, createEJSONStream, createEnvParser, createRandomizer, createSecureCustomizer, createTimeObject, createTimeSpan, createWithCache, cssVariable, dateInDays, dateInSeconds, debounce, deepAssign, deepClone, deepCloneWith, deepDefaults, deepFreeze, def, defer, delay, difference, dropCache, env, escapeHtml, escapeNumeric, escapeRegExp, fastIdle, fastIdlePromise, fastRaf, findMean, flagsToMap, flatten, formatMoney, formatNumber, get, getFileExtension, getFileName, getInitials, getMostSpecificPaths, getRandomInt, getRandomTime, getWords, groupBy, has, hasOwn, hasProtocol, hex, hexToChannels, hmToSeconds, hslToChannels, humanFileSize, humanize, interpolateColor, intersection, isBigInt, isBoolean, isCached, isClient, isColorChannels, isCustomizerFactory, isDate, isDateObject, isDef, isEmpty, isEqual, isError, isFunction, isInfinity, isMap, isNullOrUndefined, isNumber, isObject, isOneEmoji, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isSkip, isString, isSuccess, isSymbol, isTimeObject, isTimeString, isTimeValue, isValidWeekDay, isWeakMap, isWeakSet, isWithCache, isoToFlagEmoji, kebabCase, keyBy, logger, loggerSetLevel, lowerCase, luminance, maskingEmail, maskingPhone, maskingWords, nextTickIteration, noop, objectId, omit, omitPrefixed, orderBy, parseAllNumbers, parseAlpha, parsePercentage, percentOf, pick, pickPrefixed, qs, rafPromise, randomString, removeVS16s, retryOnError, rgbToChannels, round2digits, secondsToHm, set, shuffle, snakeCase, sprintf, startCase, strAssign, sum, textDecoder, textEncoder, throttle, timeFromMinutes, timeStringify, timeToMinutes, timeout, timestamp, timestampMs, timestampToDate, tintedTextColor, toError, toMap, truncate, typeOf, uint16ToUint8, uint32ToUint8, uint8ToUint16, uint8ToUint32, unflatten, union, uniq, uniqBy, unset, weeksInYear, weightedRoundRobin, withCache, withCacheBucket, withCacheBucketBatch, withCacheFixed, withCacheLRU, withDeepClone, withPointerCache, wrapText };
|
package/dist/index.d.mts
CHANGED
|
@@ -1378,7 +1378,16 @@ declare class LruCache<TKey = any, TValue = any> {
|
|
|
1378
1378
|
* @return {IterableIterator<[TKey, TValue | undefined]>}
|
|
1379
1379
|
*/
|
|
1380
1380
|
entries(): {
|
|
1381
|
-
[Symbol.iterator]():
|
|
1381
|
+
[Symbol.iterator](): {
|
|
1382
|
+
[Symbol.iterator](): /*elided*/ any;
|
|
1383
|
+
next(): {
|
|
1384
|
+
done: boolean;
|
|
1385
|
+
value: undefined;
|
|
1386
|
+
} | {
|
|
1387
|
+
done: boolean;
|
|
1388
|
+
value: (TKey | TValue | undefined)[];
|
|
1389
|
+
};
|
|
1390
|
+
};
|
|
1382
1391
|
next(): {
|
|
1383
1392
|
done: boolean;
|
|
1384
1393
|
value: undefined;
|
|
@@ -1394,7 +1403,7 @@ declare class LruCache<TKey = any, TValue = any> {
|
|
|
1394
1403
|
*/
|
|
1395
1404
|
splayOnTop(pointer: number): this;
|
|
1396
1405
|
[Symbol.iterator](): {
|
|
1397
|
-
[Symbol.iterator](): any;
|
|
1406
|
+
[Symbol.iterator](): /*elided*/ any;
|
|
1398
1407
|
next(): {
|
|
1399
1408
|
done: boolean;
|
|
1400
1409
|
value: undefined;
|
|
@@ -1911,7 +1920,7 @@ declare const ColorParser: {
|
|
|
1911
1920
|
* Calculate crc32 hash from string
|
|
1912
1921
|
* @group Crypto
|
|
1913
1922
|
*/
|
|
1914
|
-
declare function crc32(
|
|
1923
|
+
declare function crc32(value: Uint8Array | Uint8Array[] | string, seed?: number): number;
|
|
1915
1924
|
|
|
1916
1925
|
type DateObjectInput = Date | string | number | DateObject;
|
|
1917
1926
|
declare function createDateObject(value: DateObjectInput): DateObject;
|
|
@@ -3107,9 +3116,14 @@ type RetryOnErrorConfig = {
|
|
|
3107
3116
|
*/
|
|
3108
3117
|
shouldRetryBasedOnError?: (error: unknown, attempt: number) => boolean;
|
|
3109
3118
|
/**
|
|
3110
|
-
* Number of
|
|
3119
|
+
* Number of attempts to execute a function
|
|
3120
|
+
*/
|
|
3121
|
+
maxAttempts?: number;
|
|
3122
|
+
/**
|
|
3123
|
+
* Number of retries until the execution fails (initial + retries)
|
|
3124
|
+
* @deprecated use `maxAttempts`
|
|
3111
3125
|
*/
|
|
3112
|
-
maxRetriesNumber
|
|
3126
|
+
maxRetriesNumber?: number;
|
|
3113
3127
|
/**
|
|
3114
3128
|
* Delay multiply factor
|
|
3115
3129
|
*/
|
|
@@ -3143,7 +3157,7 @@ type RetryOnErrorConfig = {
|
|
|
3143
3157
|
*
|
|
3144
3158
|
* @group Utility Functions
|
|
3145
3159
|
*/
|
|
3146
|
-
declare function retryOnError<T extends AnyFunction>({ beforeRetryCallback, shouldRetryBasedOnError, maxRetriesNumber, delayFactor, delayMaxMs, delayMinMs, }: RetryOnErrorConfig, fn: T): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>;
|
|
3160
|
+
declare function retryOnError<T extends AnyFunction>({ beforeRetryCallback, shouldRetryBasedOnError, maxAttempts, maxRetriesNumber, delayFactor, delayMaxMs, delayMinMs, }: RetryOnErrorConfig, fn: T): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>;
|
|
3147
3161
|
|
|
3148
3162
|
interface ThrottleOptions {
|
|
3149
3163
|
/**
|
|
@@ -5062,6 +5076,7 @@ declare class ResourcePool<T = unknown> extends SimpleEventEmitter<ResourcePoolE
|
|
|
5062
5076
|
*/
|
|
5063
5077
|
destroy(rejectAcquires?: boolean): Promise<void>;
|
|
5064
5078
|
private tryGetAvailableResource;
|
|
5079
|
+
private isLimitReached;
|
|
5065
5080
|
private tryCreateAutoResource;
|
|
5066
5081
|
private enqueueAcquireRequest;
|
|
5067
5082
|
private moveResourceToAvailable;
|
|
@@ -5579,6 +5594,9 @@ declare const startCase: (value?: string) => string;
|
|
|
5579
5594
|
*/
|
|
5580
5595
|
declare function strAssign<T extends object>(str: string, obj: T, method?: (obj: T, key: string) => any): string;
|
|
5581
5596
|
|
|
5597
|
+
declare var textEncoder: TextEncoder;
|
|
5598
|
+
declare var textDecoder: TextDecoder;
|
|
5599
|
+
|
|
5582
5600
|
/**
|
|
5583
5601
|
* Truncates a string to the specified maximum length while preserving whole words
|
|
5584
5602
|
* and appends ellipsis (`...`) if the string exceeds the maximum length.
|
|
@@ -5644,4 +5662,4 @@ declare function wrapText(value: string, maxLength?: number): string;
|
|
|
5644
5662
|
*/
|
|
5645
5663
|
declare function toError<T>(value: T, unknownMessage?: string): T extends Error ? T : Error;
|
|
5646
5664
|
|
|
5647
|
-
export { type AnyFunction, AppError, type AppErrorOptions, type ArgumentsType, type Arrayable, AsyncIterableQueue, type Awaitable, type Base64ToBytesOptions, type BaseX, BrowserAssertionError, type BytesToBase64Options, CancellablePromise, type CatchErrorResult, Color, type ColorChannels, ColorParser, type Data, type DateObject, type DateObjectInput, type DebouncedFunction, type DeepPartial, type DeepReadonly, type Defer, instance as EJSON, EJSON as EJSONInstance, EJSONStream, type EJSONStreamOptions, type EJSONStreamOptionsWithPayload, type EJSONType, type EnvParser, type ExecResult, type ExecResultToSkip, type ExecResultToSuccess, type ExecSkip, type ExecSuccess, FindMean, FixedMap, FixedWeakMap, type Fn, type FormatMoney, type FormatNumber, type FunctionArgs, type GenericObject, type IfAny, type IsAny, type LiteralUnion, type Logger, LruCache, type Nothing, type OverwriteWith, type Prettify, type Primitive, type PromisifyFn, Queue, type RandomizerOptions, ResourcePool, type ResourcePoolEventMap, type ResourcePoolOptions, type RetryOnErrorConfig, type SecureCustomizerOptions, type SelectOptionItem, type SelectOptions, type SimpleDefaultEventMap, SimpleEventEmitter, type SimpleEventMap, SortedArray, type SortedArrayCompareFn, _default as TWEMOJI_REGEX, type ThemeConfig, type ThrottledFunction, TimeBucket, type TimeBucketOptions, type TimeObject, type TimeObjectInput, TimeSpan, type TimeSpanUnit, type TimeString, type TimeValue, type TimestampMsInput, type TypeOf, type TypeOfMap, type ValuesOfObject, type WithCache, type WithCacheBucketBatchOptions, type WithCacheBucketOptions, type WithCacheFixedOptions, type WithCacheLruOptions, type WithCacheOptions, type WithCachePointer, type WithCacheResult, type WithCacheStorage, type WithCustomizer, type WithCustomizerFactory, type WithCustomizerValue, type WrrItem, alpha, arrayable, assert, asyncFilter, asyncFind, asyncForEach, asyncMap, avg, avgCircular, base62, base62Fast, base64, base64ToBytes, base64url, basex, bigIntBytes, bigIntFromBytes, blendColors, buildCssColor, bytesToBase64, cache, cacheBucket, cacheFixed, cacheLRU, camelCase, capitalize, captureStackTrace, catchError, channelsToHSL, channelsToHex, channelsToRGB, checkBitmask, chunk, chunkSeries, clamp, cleanEmpty, cleanObject, colorToChannels, compareBytes, concatenateBytes, contrastRatio, convertToUnit, crc32, createCustomizer, createCustomizerFactory, createDateObject, createDeepCloneWith, createEJSON, createEJSONStream, createEnvParser, createRandomizer, createSecureCustomizer, createTimeObject, createTimeSpan, createWithCache, cssVariable, dateInDays, dateInSeconds, debounce, deepAssign, deepClone, deepCloneWith, deepDefaults, deepFreeze, def, defer, delay, difference, dropCache, env, escapeHtml, escapeNumeric, escapeRegExp, fastIdle, fastIdlePromise, fastRaf, findMean, flagsToMap, flatten, formatMoney, formatNumber, get, getFileExtension, getFileName, getInitials, getMostSpecificPaths, getRandomInt, getRandomTime, getWords, groupBy, has, hasOwn, hasProtocol, hex, hexToChannels, hmToSeconds, hslToChannels, humanFileSize, humanize, interpolateColor, intersection, isBigInt, isBoolean, isCached, isClient, isColorChannels, isCustomizerFactory, isDate, isDateObject, isDef, isEmpty, isEqual, isError, isFunction, isInfinity, isMap, isNullOrUndefined, isNumber, isObject, isOneEmoji, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isSkip, isString, isSuccess, isSymbol, isTimeObject, isTimeString, isTimeValue, isValidWeekDay, isWeakMap, isWeakSet, isWithCache, isoToFlagEmoji, kebabCase, keyBy, logger, loggerSetLevel, lowerCase, luminance, maskingEmail, maskingPhone, maskingWords, nextTickIteration, noop, objectId, omit, omitPrefixed, orderBy, parseAllNumbers, parseAlpha, parsePercentage, percentOf, pick, pickPrefixed, qs, rafPromise, randomString, removeVS16s, retryOnError, rgbToChannels, round2digits, secondsToHm, set, shuffle, snakeCase, sprintf, startCase, strAssign, sum, throttle, timeFromMinutes, timeStringify, timeToMinutes, timeout, timestamp, timestampMs, timestampToDate, tintedTextColor, toError, toMap, truncate, typeOf, uint16ToUint8, uint32ToUint8, uint8ToUint16, uint8ToUint32, unflatten, union, uniq, uniqBy, unset, weeksInYear, weightedRoundRobin, withCache, withCacheBucket, withCacheBucketBatch, withCacheFixed, withCacheLRU, withDeepClone, withPointerCache, wrapText };
|
|
5665
|
+
export { type AnyFunction, AppError, type AppErrorOptions, type ArgumentsType, type Arrayable, AsyncIterableQueue, type Awaitable, type Base64ToBytesOptions, type BaseX, BrowserAssertionError, type BytesToBase64Options, CancellablePromise, type CatchErrorResult, Color, type ColorChannels, ColorParser, type Data, type DateObject, type DateObjectInput, type DebouncedFunction, type DeepPartial, type DeepReadonly, type Defer, instance as EJSON, EJSON as EJSONInstance, EJSONStream, type EJSONStreamOptions, type EJSONStreamOptionsWithPayload, type EJSONType, type EnvParser, type ExecResult, type ExecResultToSkip, type ExecResultToSuccess, type ExecSkip, type ExecSuccess, FindMean, FixedMap, FixedWeakMap, type Fn, type FormatMoney, type FormatNumber, type FunctionArgs, type GenericObject, type IfAny, type IsAny, type LiteralUnion, type Logger, LruCache, type Nothing, type OverwriteWith, type Prettify, type Primitive, type PromisifyFn, Queue, type RandomizerOptions, ResourcePool, type ResourcePoolEventMap, type ResourcePoolOptions, type RetryOnErrorConfig, type SecureCustomizerOptions, type SelectOptionItem, type SelectOptions, type SimpleDefaultEventMap, SimpleEventEmitter, type SimpleEventMap, SortedArray, type SortedArrayCompareFn, _default as TWEMOJI_REGEX, type ThemeConfig, type ThrottledFunction, TimeBucket, type TimeBucketOptions, type TimeObject, type TimeObjectInput, TimeSpan, type TimeSpanUnit, type TimeString, type TimeValue, type TimestampMsInput, type TypeOf, type TypeOfMap, type ValuesOfObject, type WithCache, type WithCacheBucketBatchOptions, type WithCacheBucketOptions, type WithCacheFixedOptions, type WithCacheLruOptions, type WithCacheOptions, type WithCachePointer, type WithCacheResult, type WithCacheStorage, type WithCustomizer, type WithCustomizerFactory, type WithCustomizerValue, type WrrItem, alpha, arrayable, assert, asyncFilter, asyncFind, asyncForEach, asyncMap, avg, avgCircular, base62, base62Fast, base64, base64ToBytes, base64url, basex, bigIntBytes, bigIntFromBytes, blendColors, buildCssColor, bytesToBase64, cache, cacheBucket, cacheFixed, cacheLRU, camelCase, capitalize, captureStackTrace, catchError, channelsToHSL, channelsToHex, channelsToRGB, checkBitmask, chunk, chunkSeries, clamp, cleanEmpty, cleanObject, colorToChannels, compareBytes, concatenateBytes, contrastRatio, convertToUnit, crc32, createCustomizer, createCustomizerFactory, createDateObject, createDeepCloneWith, createEJSON, createEJSONStream, createEnvParser, createRandomizer, createSecureCustomizer, createTimeObject, createTimeSpan, createWithCache, cssVariable, dateInDays, dateInSeconds, debounce, deepAssign, deepClone, deepCloneWith, deepDefaults, deepFreeze, def, defer, delay, difference, dropCache, env, escapeHtml, escapeNumeric, escapeRegExp, fastIdle, fastIdlePromise, fastRaf, findMean, flagsToMap, flatten, formatMoney, formatNumber, get, getFileExtension, getFileName, getInitials, getMostSpecificPaths, getRandomInt, getRandomTime, getWords, groupBy, has, hasOwn, hasProtocol, hex, hexToChannels, hmToSeconds, hslToChannels, humanFileSize, humanize, interpolateColor, intersection, isBigInt, isBoolean, isCached, isClient, isColorChannels, isCustomizerFactory, isDate, isDateObject, isDef, isEmpty, isEqual, isError, isFunction, isInfinity, isMap, isNullOrUndefined, isNumber, isObject, isOneEmoji, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isSkip, isString, isSuccess, isSymbol, isTimeObject, isTimeString, isTimeValue, isValidWeekDay, isWeakMap, isWeakSet, isWithCache, isoToFlagEmoji, kebabCase, keyBy, logger, loggerSetLevel, lowerCase, luminance, maskingEmail, maskingPhone, maskingWords, nextTickIteration, noop, objectId, omit, omitPrefixed, orderBy, parseAllNumbers, parseAlpha, parsePercentage, percentOf, pick, pickPrefixed, qs, rafPromise, randomString, removeVS16s, retryOnError, rgbToChannels, round2digits, secondsToHm, set, shuffle, snakeCase, sprintf, startCase, strAssign, sum, textDecoder, textEncoder, throttle, timeFromMinutes, timeStringify, timeToMinutes, timeout, timestamp, timestampMs, timestampToDate, tintedTextColor, toError, toMap, truncate, typeOf, uint16ToUint8, uint32ToUint8, uint8ToUint16, uint8ToUint32, unflatten, union, uniq, uniqBy, unset, weeksInYear, weightedRoundRobin, withCache, withCacheBucket, withCacheBucketBatch, withCacheFixed, withCacheLRU, withDeepClone, withPointerCache, wrapText };
|
package/dist/index.d.ts
CHANGED
|
@@ -1378,7 +1378,16 @@ declare class LruCache<TKey = any, TValue = any> {
|
|
|
1378
1378
|
* @return {IterableIterator<[TKey, TValue | undefined]>}
|
|
1379
1379
|
*/
|
|
1380
1380
|
entries(): {
|
|
1381
|
-
[Symbol.iterator]():
|
|
1381
|
+
[Symbol.iterator](): {
|
|
1382
|
+
[Symbol.iterator](): /*elided*/ any;
|
|
1383
|
+
next(): {
|
|
1384
|
+
done: boolean;
|
|
1385
|
+
value: undefined;
|
|
1386
|
+
} | {
|
|
1387
|
+
done: boolean;
|
|
1388
|
+
value: (TKey | TValue | undefined)[];
|
|
1389
|
+
};
|
|
1390
|
+
};
|
|
1382
1391
|
next(): {
|
|
1383
1392
|
done: boolean;
|
|
1384
1393
|
value: undefined;
|
|
@@ -1394,7 +1403,7 @@ declare class LruCache<TKey = any, TValue = any> {
|
|
|
1394
1403
|
*/
|
|
1395
1404
|
splayOnTop(pointer: number): this;
|
|
1396
1405
|
[Symbol.iterator](): {
|
|
1397
|
-
[Symbol.iterator](): any;
|
|
1406
|
+
[Symbol.iterator](): /*elided*/ any;
|
|
1398
1407
|
next(): {
|
|
1399
1408
|
done: boolean;
|
|
1400
1409
|
value: undefined;
|
|
@@ -1911,7 +1920,7 @@ declare const ColorParser: {
|
|
|
1911
1920
|
* Calculate crc32 hash from string
|
|
1912
1921
|
* @group Crypto
|
|
1913
1922
|
*/
|
|
1914
|
-
declare function crc32(
|
|
1923
|
+
declare function crc32(value: Uint8Array | Uint8Array[] | string, seed?: number): number;
|
|
1915
1924
|
|
|
1916
1925
|
type DateObjectInput = Date | string | number | DateObject;
|
|
1917
1926
|
declare function createDateObject(value: DateObjectInput): DateObject;
|
|
@@ -3107,9 +3116,14 @@ type RetryOnErrorConfig = {
|
|
|
3107
3116
|
*/
|
|
3108
3117
|
shouldRetryBasedOnError?: (error: unknown, attempt: number) => boolean;
|
|
3109
3118
|
/**
|
|
3110
|
-
* Number of
|
|
3119
|
+
* Number of attempts to execute a function
|
|
3120
|
+
*/
|
|
3121
|
+
maxAttempts?: number;
|
|
3122
|
+
/**
|
|
3123
|
+
* Number of retries until the execution fails (initial + retries)
|
|
3124
|
+
* @deprecated use `maxAttempts`
|
|
3111
3125
|
*/
|
|
3112
|
-
maxRetriesNumber
|
|
3126
|
+
maxRetriesNumber?: number;
|
|
3113
3127
|
/**
|
|
3114
3128
|
* Delay multiply factor
|
|
3115
3129
|
*/
|
|
@@ -3143,7 +3157,7 @@ type RetryOnErrorConfig = {
|
|
|
3143
3157
|
*
|
|
3144
3158
|
* @group Utility Functions
|
|
3145
3159
|
*/
|
|
3146
|
-
declare function retryOnError<T extends AnyFunction>({ beforeRetryCallback, shouldRetryBasedOnError, maxRetriesNumber, delayFactor, delayMaxMs, delayMinMs, }: RetryOnErrorConfig, fn: T): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>;
|
|
3160
|
+
declare function retryOnError<T extends AnyFunction>({ beforeRetryCallback, shouldRetryBasedOnError, maxAttempts, maxRetriesNumber, delayFactor, delayMaxMs, delayMinMs, }: RetryOnErrorConfig, fn: T): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>;
|
|
3147
3161
|
|
|
3148
3162
|
interface ThrottleOptions {
|
|
3149
3163
|
/**
|
|
@@ -5062,6 +5076,7 @@ declare class ResourcePool<T = unknown> extends SimpleEventEmitter<ResourcePoolE
|
|
|
5062
5076
|
*/
|
|
5063
5077
|
destroy(rejectAcquires?: boolean): Promise<void>;
|
|
5064
5078
|
private tryGetAvailableResource;
|
|
5079
|
+
private isLimitReached;
|
|
5065
5080
|
private tryCreateAutoResource;
|
|
5066
5081
|
private enqueueAcquireRequest;
|
|
5067
5082
|
private moveResourceToAvailable;
|
|
@@ -5579,6 +5594,9 @@ declare const startCase: (value?: string) => string;
|
|
|
5579
5594
|
*/
|
|
5580
5595
|
declare function strAssign<T extends object>(str: string, obj: T, method?: (obj: T, key: string) => any): string;
|
|
5581
5596
|
|
|
5597
|
+
declare var textEncoder: TextEncoder;
|
|
5598
|
+
declare var textDecoder: TextDecoder;
|
|
5599
|
+
|
|
5582
5600
|
/**
|
|
5583
5601
|
* Truncates a string to the specified maximum length while preserving whole words
|
|
5584
5602
|
* and appends ellipsis (`...`) if the string exceeds the maximum length.
|
|
@@ -5644,4 +5662,4 @@ declare function wrapText(value: string, maxLength?: number): string;
|
|
|
5644
5662
|
*/
|
|
5645
5663
|
declare function toError<T>(value: T, unknownMessage?: string): T extends Error ? T : Error;
|
|
5646
5664
|
|
|
5647
|
-
export { type AnyFunction, AppError, type AppErrorOptions, type ArgumentsType, type Arrayable, AsyncIterableQueue, type Awaitable, type Base64ToBytesOptions, type BaseX, BrowserAssertionError, type BytesToBase64Options, CancellablePromise, type CatchErrorResult, Color, type ColorChannels, ColorParser, type Data, type DateObject, type DateObjectInput, type DebouncedFunction, type DeepPartial, type DeepReadonly, type Defer, instance as EJSON, EJSON as EJSONInstance, EJSONStream, type EJSONStreamOptions, type EJSONStreamOptionsWithPayload, type EJSONType, type EnvParser, type ExecResult, type ExecResultToSkip, type ExecResultToSuccess, type ExecSkip, type ExecSuccess, FindMean, FixedMap, FixedWeakMap, type Fn, type FormatMoney, type FormatNumber, type FunctionArgs, type GenericObject, type IfAny, type IsAny, type LiteralUnion, type Logger, LruCache, type Nothing, type OverwriteWith, type Prettify, type Primitive, type PromisifyFn, Queue, type RandomizerOptions, ResourcePool, type ResourcePoolEventMap, type ResourcePoolOptions, type RetryOnErrorConfig, type SecureCustomizerOptions, type SelectOptionItem, type SelectOptions, type SimpleDefaultEventMap, SimpleEventEmitter, type SimpleEventMap, SortedArray, type SortedArrayCompareFn, _default as TWEMOJI_REGEX, type ThemeConfig, type ThrottledFunction, TimeBucket, type TimeBucketOptions, type TimeObject, type TimeObjectInput, TimeSpan, type TimeSpanUnit, type TimeString, type TimeValue, type TimestampMsInput, type TypeOf, type TypeOfMap, type ValuesOfObject, type WithCache, type WithCacheBucketBatchOptions, type WithCacheBucketOptions, type WithCacheFixedOptions, type WithCacheLruOptions, type WithCacheOptions, type WithCachePointer, type WithCacheResult, type WithCacheStorage, type WithCustomizer, type WithCustomizerFactory, type WithCustomizerValue, type WrrItem, alpha, arrayable, assert, asyncFilter, asyncFind, asyncForEach, asyncMap, avg, avgCircular, base62, base62Fast, base64, base64ToBytes, base64url, basex, bigIntBytes, bigIntFromBytes, blendColors, buildCssColor, bytesToBase64, cache, cacheBucket, cacheFixed, cacheLRU, camelCase, capitalize, captureStackTrace, catchError, channelsToHSL, channelsToHex, channelsToRGB, checkBitmask, chunk, chunkSeries, clamp, cleanEmpty, cleanObject, colorToChannels, compareBytes, concatenateBytes, contrastRatio, convertToUnit, crc32, createCustomizer, createCustomizerFactory, createDateObject, createDeepCloneWith, createEJSON, createEJSONStream, createEnvParser, createRandomizer, createSecureCustomizer, createTimeObject, createTimeSpan, createWithCache, cssVariable, dateInDays, dateInSeconds, debounce, deepAssign, deepClone, deepCloneWith, deepDefaults, deepFreeze, def, defer, delay, difference, dropCache, env, escapeHtml, escapeNumeric, escapeRegExp, fastIdle, fastIdlePromise, fastRaf, findMean, flagsToMap, flatten, formatMoney, formatNumber, get, getFileExtension, getFileName, getInitials, getMostSpecificPaths, getRandomInt, getRandomTime, getWords, groupBy, has, hasOwn, hasProtocol, hex, hexToChannels, hmToSeconds, hslToChannels, humanFileSize, humanize, interpolateColor, intersection, isBigInt, isBoolean, isCached, isClient, isColorChannels, isCustomizerFactory, isDate, isDateObject, isDef, isEmpty, isEqual, isError, isFunction, isInfinity, isMap, isNullOrUndefined, isNumber, isObject, isOneEmoji, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isSkip, isString, isSuccess, isSymbol, isTimeObject, isTimeString, isTimeValue, isValidWeekDay, isWeakMap, isWeakSet, isWithCache, isoToFlagEmoji, kebabCase, keyBy, logger, loggerSetLevel, lowerCase, luminance, maskingEmail, maskingPhone, maskingWords, nextTickIteration, noop, objectId, omit, omitPrefixed, orderBy, parseAllNumbers, parseAlpha, parsePercentage, percentOf, pick, pickPrefixed, qs, rafPromise, randomString, removeVS16s, retryOnError, rgbToChannels, round2digits, secondsToHm, set, shuffle, snakeCase, sprintf, startCase, strAssign, sum, throttle, timeFromMinutes, timeStringify, timeToMinutes, timeout, timestamp, timestampMs, timestampToDate, tintedTextColor, toError, toMap, truncate, typeOf, uint16ToUint8, uint32ToUint8, uint8ToUint16, uint8ToUint32, unflatten, union, uniq, uniqBy, unset, weeksInYear, weightedRoundRobin, withCache, withCacheBucket, withCacheBucketBatch, withCacheFixed, withCacheLRU, withDeepClone, withPointerCache, wrapText };
|
|
5665
|
+
export { type AnyFunction, AppError, type AppErrorOptions, type ArgumentsType, type Arrayable, AsyncIterableQueue, type Awaitable, type Base64ToBytesOptions, type BaseX, BrowserAssertionError, type BytesToBase64Options, CancellablePromise, type CatchErrorResult, Color, type ColorChannels, ColorParser, type Data, type DateObject, type DateObjectInput, type DebouncedFunction, type DeepPartial, type DeepReadonly, type Defer, instance as EJSON, EJSON as EJSONInstance, EJSONStream, type EJSONStreamOptions, type EJSONStreamOptionsWithPayload, type EJSONType, type EnvParser, type ExecResult, type ExecResultToSkip, type ExecResultToSuccess, type ExecSkip, type ExecSuccess, FindMean, FixedMap, FixedWeakMap, type Fn, type FormatMoney, type FormatNumber, type FunctionArgs, type GenericObject, type IfAny, type IsAny, type LiteralUnion, type Logger, LruCache, type Nothing, type OverwriteWith, type Prettify, type Primitive, type PromisifyFn, Queue, type RandomizerOptions, ResourcePool, type ResourcePoolEventMap, type ResourcePoolOptions, type RetryOnErrorConfig, type SecureCustomizerOptions, type SelectOptionItem, type SelectOptions, type SimpleDefaultEventMap, SimpleEventEmitter, type SimpleEventMap, SortedArray, type SortedArrayCompareFn, _default as TWEMOJI_REGEX, type ThemeConfig, type ThrottledFunction, TimeBucket, type TimeBucketOptions, type TimeObject, type TimeObjectInput, TimeSpan, type TimeSpanUnit, type TimeString, type TimeValue, type TimestampMsInput, type TypeOf, type TypeOfMap, type ValuesOfObject, type WithCache, type WithCacheBucketBatchOptions, type WithCacheBucketOptions, type WithCacheFixedOptions, type WithCacheLruOptions, type WithCacheOptions, type WithCachePointer, type WithCacheResult, type WithCacheStorage, type WithCustomizer, type WithCustomizerFactory, type WithCustomizerValue, type WrrItem, alpha, arrayable, assert, asyncFilter, asyncFind, asyncForEach, asyncMap, avg, avgCircular, base62, base62Fast, base64, base64ToBytes, base64url, basex, bigIntBytes, bigIntFromBytes, blendColors, buildCssColor, bytesToBase64, cache, cacheBucket, cacheFixed, cacheLRU, camelCase, capitalize, captureStackTrace, catchError, channelsToHSL, channelsToHex, channelsToRGB, checkBitmask, chunk, chunkSeries, clamp, cleanEmpty, cleanObject, colorToChannels, compareBytes, concatenateBytes, contrastRatio, convertToUnit, crc32, createCustomizer, createCustomizerFactory, createDateObject, createDeepCloneWith, createEJSON, createEJSONStream, createEnvParser, createRandomizer, createSecureCustomizer, createTimeObject, createTimeSpan, createWithCache, cssVariable, dateInDays, dateInSeconds, debounce, deepAssign, deepClone, deepCloneWith, deepDefaults, deepFreeze, def, defer, delay, difference, dropCache, env, escapeHtml, escapeNumeric, escapeRegExp, fastIdle, fastIdlePromise, fastRaf, findMean, flagsToMap, flatten, formatMoney, formatNumber, get, getFileExtension, getFileName, getInitials, getMostSpecificPaths, getRandomInt, getRandomTime, getWords, groupBy, has, hasOwn, hasProtocol, hex, hexToChannels, hmToSeconds, hslToChannels, humanFileSize, humanize, interpolateColor, intersection, isBigInt, isBoolean, isCached, isClient, isColorChannels, isCustomizerFactory, isDate, isDateObject, isDef, isEmpty, isEqual, isError, isFunction, isInfinity, isMap, isNullOrUndefined, isNumber, isObject, isOneEmoji, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isSkip, isString, isSuccess, isSymbol, isTimeObject, isTimeString, isTimeValue, isValidWeekDay, isWeakMap, isWeakSet, isWithCache, isoToFlagEmoji, kebabCase, keyBy, logger, loggerSetLevel, lowerCase, luminance, maskingEmail, maskingPhone, maskingWords, nextTickIteration, noop, objectId, omit, omitPrefixed, orderBy, parseAllNumbers, parseAlpha, parsePercentage, percentOf, pick, pickPrefixed, qs, rafPromise, randomString, removeVS16s, retryOnError, rgbToChannels, round2digits, secondsToHm, set, shuffle, snakeCase, sprintf, startCase, strAssign, sum, textDecoder, textEncoder, throttle, timeFromMinutes, timeStringify, timeToMinutes, timeout, timestamp, timestampMs, timestampToDate, tintedTextColor, toError, toMap, truncate, typeOf, uint16ToUint8, uint32ToUint8, uint8ToUint16, uint8ToUint32, unflatten, union, uniq, uniqBy, unset, weeksInYear, weightedRoundRobin, withCache, withCacheBucket, withCacheBucketBatch, withCacheFixed, withCacheLRU, withDeepClone, withPointerCache, wrapText };
|