@naturalcycles/js-lib 14.108.0 → 14.109.1
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/array/array.util.d.ts +2 -2
- package/dist/datetime/dateInterval.d.ts +2 -1
- package/dist/datetime/localDate.d.ts +1 -1
- package/dist/datetime/localTime.d.ts +3 -2
- package/dist/datetime/timeInterval.d.ts +4 -3
- package/dist/decorators/asyncMemo.decorator.d.ts +2 -2
- package/dist/decorators/debounce.d.ts +1 -1
- package/dist/decorators/debounce.decorator.d.ts +1 -1
- package/dist/decorators/decorator.util.d.ts +1 -1
- package/dist/decorators/logMethod.decorator.d.ts +1 -1
- package/dist/decorators/memo.decorator.d.ts +2 -2
- package/dist/decorators/memo.util.d.ts +1 -1
- package/dist/decorators/memoFn.d.ts +2 -2
- package/dist/decorators/memoFnAsync.d.ts +2 -2
- package/dist/decorators/memoSimple.decorator.d.ts +1 -1
- package/dist/decorators/retry.decorator.d.ts +1 -1
- package/dist/decorators/timeout.decorator.d.ts +1 -1
- package/dist/enum.util.d.ts +1 -1
- package/dist/error/app.error.d.ts +1 -1
- package/dist/error/assert.d.ts +1 -1
- package/dist/error/error.util.d.ts +2 -1
- package/dist/error/http.error.d.ts +1 -1
- package/dist/error/try.d.ts +1 -1
- package/dist/error/tryCatch.d.ts +2 -2
- package/dist/index.d.ts +27 -19
- package/dist/index.js +0 -1
- package/dist/is.util.d.ts +2 -2
- package/dist/json-schema/from-data/generateJsonSchemaFromData.d.ts +1 -1
- package/dist/json-schema/jsonSchema.cnst.d.ts +1 -1
- package/dist/json-schema/jsonSchema.model.d.ts +1 -1
- package/dist/json-schema/jsonSchema.util.d.ts +1 -1
- package/dist/json-schema/jsonSchemaBuilder.d.ts +2 -2
- package/dist/json-schema/jsonSchemas.d.ts +1 -1
- package/dist/lazy.d.ts +1 -1
- package/dist/object/object.util.d.ts +2 -2
- package/dist/object/sortObject.d.ts +1 -1
- package/dist/promise/pFilter.d.ts +1 -1
- package/dist/promise/pMap.d.ts +2 -1
- package/dist/promise/pQueue.d.ts +1 -1
- package/dist/promise/pRetry.d.ts +1 -1
- package/dist/promise/pTimeout.d.ts +2 -2
- package/dist/seq/seq.d.ts +2 -1
- package/dist/string/readingTime.d.ts +13 -2
- package/dist/string/safeJsonStringify.d.ts +1 -1
- package/dist/string/stringifyAny.d.ts +1 -1
- package/dist/string/url.util.d.ts +1 -1
- package/dist/types.d.ts +4 -6
- package/dist/types.js +3 -14
- package/dist-esm/error/error.util.js +1 -1
- package/dist-esm/index.js +2 -3
- package/dist-esm/json-schema/from-data/generateJsonSchemaFromData.js +1 -1
- package/dist-esm/json-schema/jsonSchemaBuilder.js +1 -1
- package/dist-esm/seq/seq.js +1 -1
- package/dist-esm/types.js +3 -11
- package/package.json +2 -4
- package/src/array/array.util.ts +2 -2
- package/src/datetime/dateInterval.ts +2 -1
- package/src/datetime/localDate.ts +1 -1
- package/src/datetime/localTime.ts +3 -2
- package/src/datetime/timeInterval.ts +4 -3
- package/src/decorators/asyncMemo.decorator.ts +4 -3
- package/src/decorators/debounce.decorator.ts +2 -1
- package/src/decorators/debounce.ts +1 -1
- package/src/decorators/decorator.util.ts +1 -1
- package/src/decorators/logMethod.decorator.ts +2 -1
- package/src/decorators/memo.decorator.ts +4 -3
- package/src/decorators/memo.util.ts +1 -1
- package/src/decorators/memoFn.ts +3 -2
- package/src/decorators/memoFnAsync.ts +3 -2
- package/src/decorators/memoSimple.decorator.ts +3 -2
- package/src/decorators/retry.decorator.ts +2 -1
- package/src/decorators/timeout.decorator.ts +2 -1
- package/src/enum.util.ts +1 -1
- package/src/error/app.error.ts +1 -1
- package/src/error/assert.ts +2 -1
- package/src/error/error.util.ts +2 -4
- package/src/error/http.error.ts +1 -1
- package/src/error/try.ts +1 -1
- package/src/error/tryCatch.ts +3 -2
- package/src/index.ts +27 -27
- package/src/is.util.ts +2 -2
- package/src/json-schema/from-data/generateJsonSchemaFromData.ts +2 -3
- package/src/json-schema/jsonSchema.cnst.ts +1 -1
- package/src/json-schema/jsonSchema.model.ts +1 -1
- package/src/json-schema/jsonSchema.util.ts +1 -1
- package/src/json-schema/jsonSchemaBuilder.ts +3 -5
- package/src/json-schema/jsonSchemas.ts +1 -1
- package/src/lazy.ts +1 -1
- package/src/object/object.util.ts +2 -2
- package/src/object/sortObject.ts +2 -1
- package/src/promise/pFilter.ts +1 -1
- package/src/promise/pMap.ts +2 -1
- package/src/promise/pQueue.ts +3 -2
- package/src/promise/pRetry.ts +2 -1
- package/src/promise/pTimeout.ts +2 -2
- package/src/seq/seq.ts +2 -3
- package/src/string/readingTime.ts +14 -2
- package/src/string/safeJsonStringify.ts +1 -1
- package/src/string/stringifyAny.ts +1 -1
- package/src/string/url.util.ts +1 -1
- package/src/types.ts +4 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RecursiveArray } from '../lodash.types';
|
|
2
|
-
import { FalsyValue, Mapper, Predicate, StringMap } from '../types';
|
|
1
|
+
import type { RecursiveArray } from '../lodash.types';
|
|
2
|
+
import type { FalsyValue, Mapper, Predicate, StringMap } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the
|
|
5
5
|
* final chunk will be the remaining elements.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Inclusiveness,
|
|
1
|
+
import type { Inclusiveness, LocalDateConfig, LocalDateUnit } from './localDate';
|
|
2
|
+
import { LocalDate } from './localDate';
|
|
2
3
|
export declare type DateIntervalConfig = DateInterval | DateIntervalString;
|
|
3
4
|
export declare type DateIntervalString = string;
|
|
4
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IsoDateString, IsoDateTimeString, UnixTimestampMillisNumber, UnixTimestampNumber } from '../types';
|
|
1
|
+
import type { IsoDateString, IsoDateTimeString, UnixTimestampMillisNumber, UnixTimestampNumber } from '../types';
|
|
2
2
|
import { LocalTime } from './localTime';
|
|
3
3
|
export declare type LocalDateUnit = LocalDateUnitStrict | 'week';
|
|
4
4
|
export declare type LocalDateUnitStrict = 'year' | 'month' | 'day';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IsoDateString, IsoDateTimeString, UnixTimestampMillisNumber, UnixTimestampNumber } from '../types';
|
|
2
|
-
import { Inclusiveness
|
|
1
|
+
import type { IsoDateString, IsoDateTimeString, UnixTimestampMillisNumber, UnixTimestampNumber } from '../types';
|
|
2
|
+
import type { Inclusiveness } from './localDate';
|
|
3
|
+
import { LocalDate } from './localDate';
|
|
3
4
|
export declare type LocalTimeUnit = 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second';
|
|
4
5
|
export declare enum ISODayOfWeek {
|
|
5
6
|
MONDAY = 1,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { UnixTimestampNumber } from '../types';
|
|
2
|
-
import { Inclusiveness } from './localDate';
|
|
3
|
-
import {
|
|
1
|
+
import type { UnixTimestampNumber } from '../types';
|
|
2
|
+
import type { Inclusiveness } from './localDate';
|
|
3
|
+
import type { LocalTimeConfig } from './localTime';
|
|
4
|
+
import { LocalTime } from './localTime';
|
|
4
5
|
export declare type TimeIntervalConfig = TimeInterval | TimeIntervalString;
|
|
5
6
|
export declare type TimeIntervalString = string;
|
|
6
7
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CommonLogger } from '../log/commonLogger';
|
|
2
|
-
import { AsyncMemoCache } from './memo.util';
|
|
1
|
+
import type { CommonLogger } from '../log/commonLogger';
|
|
2
|
+
import type { AsyncMemoCache } from './memo.util';
|
|
3
3
|
export interface AsyncMemoOptions {
|
|
4
4
|
/**
|
|
5
5
|
* Provide a custom implementation of MemoCache.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DebounceOptions, ThrottleOptions } from './debounce';
|
|
1
|
+
import type { DebounceOptions, ThrottleOptions } from './debounce';
|
|
2
2
|
export declare function _Debounce(wait: number, opt?: DebounceOptions): MethodDecorator;
|
|
3
3
|
export declare function _Throttle(wait: number, opt?: ThrottleOptions): MethodDecorator;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CommonLogger } from '../log/commonLogger';
|
|
2
|
-
import { MemoCache } from './memo.util';
|
|
1
|
+
import type { CommonLogger } from '../log/commonLogger';
|
|
2
|
+
import type { MemoCache } from './memo.util';
|
|
3
3
|
export interface MemoOptions {
|
|
4
4
|
/**
|
|
5
5
|
* Provide a custom implementation of MemoCache.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AsyncMemoOptions } from './asyncMemo.decorator';
|
|
2
|
-
import { AsyncMemoCache } from './memo.util';
|
|
1
|
+
import type { AsyncMemoOptions } from './asyncMemo.decorator';
|
|
2
|
+
import type { AsyncMemoCache } from './memo.util';
|
|
3
3
|
export interface MemoizedAsyncFunction {
|
|
4
4
|
cache: AsyncMemoCache;
|
|
5
5
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PRetryOptions } from '..';
|
|
1
|
+
import type { PRetryOptions } from '..';
|
|
2
2
|
export declare function _Retry(opt?: PRetryOptions): MethodDecorator;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PTimeoutOptions } from '../promise/pTimeout';
|
|
1
|
+
import type { PTimeoutOptions } from '../promise/pTimeout';
|
|
2
2
|
export declare function _Timeout(opt: PTimeoutOptions): MethodDecorator;
|
package/dist/enum.util.d.ts
CHANGED
package/dist/error/assert.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ErrorData, ErrorObject, HttpErrorData, HttpErrorResponse, StringifyAnyOptions, Class } from '..';
|
|
2
|
+
import { AppError } from '..';
|
|
2
3
|
/**
|
|
3
4
|
* Useful to ensure that error in `catch (err) { ... }`
|
|
4
5
|
* is indeed an Error (and not e.g `string` or `undefined`).
|
package/dist/error/try.d.ts
CHANGED
package/dist/error/tryCatch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CommonLogger } from '../index';
|
|
2
|
-
import { AnyFunction } from '../types';
|
|
1
|
+
import type { CommonLogger } from '../index';
|
|
2
|
+
import type { AnyFunction } from '../types';
|
|
3
3
|
export interface TryCatchOptions {
|
|
4
4
|
/**
|
|
5
5
|
* The value returned from the function will be returned from the wrapped method (!).
|
package/dist/index.d.ts
CHANGED
|
@@ -2,14 +2,15 @@ export * from './array/array.util';
|
|
|
2
2
|
export * from './lazy';
|
|
3
3
|
export * from './string/url.util';
|
|
4
4
|
export * from './array/range';
|
|
5
|
-
import { PromiseDecoratorCfg, PromiseDecoratorResp
|
|
5
|
+
import type { PromiseDecoratorCfg, PromiseDecoratorResp } from './decorators/createPromiseDecorator';
|
|
6
|
+
import { _createPromiseDecorator } from './decorators/createPromiseDecorator';
|
|
6
7
|
export * from './decorators/debounce';
|
|
7
8
|
export * from './decorators/debounce.decorator';
|
|
8
9
|
export * from './decorators/decorator.util';
|
|
9
10
|
export * from './decorators/logMethod.decorator';
|
|
10
11
|
export * from './decorators/memo.decorator';
|
|
11
12
|
export * from './decorators/asyncMemo.decorator';
|
|
12
|
-
import { MemoCache, AsyncMemoCache } from './decorators/memo.util';
|
|
13
|
+
import type { MemoCache, AsyncMemoCache } from './decorators/memo.util';
|
|
13
14
|
export * from './decorators/memoFn';
|
|
14
15
|
export * from './decorators/memoFnAsync';
|
|
15
16
|
export * from './decorators/retry.decorator';
|
|
@@ -17,17 +18,19 @@ export * from './decorators/timeout.decorator';
|
|
|
17
18
|
export * from './error/app.error';
|
|
18
19
|
export * from './error/assert';
|
|
19
20
|
export * from './enum.util';
|
|
20
|
-
import { Admin401ErrorData, Admin403ErrorData, ErrorData, ErrorObject, HttpErrorData, HttpErrorResponse } from './error/error.model';
|
|
21
|
+
import type { Admin401ErrorData, Admin403ErrorData, ErrorData, ErrorObject, HttpErrorData, HttpErrorResponse } from './error/error.model';
|
|
21
22
|
export * from './error/error.util';
|
|
22
23
|
import { ErrorMode } from './error/errorMode';
|
|
23
24
|
export * from './error/http.error';
|
|
24
25
|
export * from './error/try';
|
|
25
|
-
import { TryCatchOptions
|
|
26
|
+
import type { TryCatchOptions } from './error/tryCatch';
|
|
27
|
+
import { _TryCatch, _tryCatch } from './error/tryCatch';
|
|
26
28
|
export * from './json-schema/from-data/generateJsonSchemaFromData';
|
|
27
29
|
export * from './json-schema/jsonSchema.cnst';
|
|
28
|
-
import { JsonSchema, JsonSchemaAllOf, JsonSchemaAny, JsonSchemaAnyOf, JsonSchemaArray, JsonSchemaBoolean, JsonSchemaConst, JsonSchemaEnum, JsonSchemaNot, JsonSchemaNull, JsonSchemaNumber, JsonSchemaRootObject, JsonSchemaObject, JsonSchemaOneOf, JsonSchemaRef, JsonSchemaString, JsonSchemaTuple } from './json-schema/jsonSchema.model';
|
|
30
|
+
import type { JsonSchema, JsonSchemaAllOf, JsonSchemaAny, JsonSchemaAnyOf, JsonSchemaArray, JsonSchemaBoolean, JsonSchemaConst, JsonSchemaEnum, JsonSchemaNot, JsonSchemaNull, JsonSchemaNumber, JsonSchemaRootObject, JsonSchemaObject, JsonSchemaOneOf, JsonSchemaRef, JsonSchemaString, JsonSchemaTuple } from './json-schema/jsonSchema.model';
|
|
29
31
|
export * from './json-schema/jsonSchema.util';
|
|
30
|
-
import {
|
|
32
|
+
import type { JsonSchemaBuilder } from './json-schema/jsonSchemaBuilder';
|
|
33
|
+
import { jsonSchema, JsonSchemaAnyBuilder } from './json-schema/jsonSchemaBuilder';
|
|
31
34
|
export * from './math/math.util';
|
|
32
35
|
export * from './math/sma';
|
|
33
36
|
export * from './number/createDeterministicRandom';
|
|
@@ -37,33 +40,38 @@ export * from './object/object.util';
|
|
|
37
40
|
export * from './object/sortObject';
|
|
38
41
|
export * from './object/sortObjectDeep';
|
|
39
42
|
import { AggregatedError } from './promise/AggregatedError';
|
|
40
|
-
import { DeferredPromise
|
|
43
|
+
import type { DeferredPromise } from './promise/pDefer';
|
|
44
|
+
import { pDefer } from './promise/pDefer';
|
|
41
45
|
export * from './promise/pDelay';
|
|
42
46
|
export * from './promise/pFilter';
|
|
43
47
|
export * from './promise/pHang';
|
|
44
|
-
import {
|
|
48
|
+
import type { PMapOptions } from './promise/pMap';
|
|
49
|
+
import { pMap } from './promise/pMap';
|
|
45
50
|
export * from './promise/pProps';
|
|
46
|
-
import {
|
|
51
|
+
import type { PRetryOptions } from './promise/pRetry';
|
|
52
|
+
import { pRetry, pRetryFn } from './promise/pRetry';
|
|
47
53
|
export * from './promise/pState';
|
|
48
|
-
import {
|
|
54
|
+
import type { PTimeoutOptions } from './promise/pTimeout';
|
|
55
|
+
import { pTimeout, pTimeoutFn } from './promise/pTimeout';
|
|
49
56
|
export * from './string/case';
|
|
50
57
|
export * from './string/json.util';
|
|
51
58
|
export * from './string/string.util';
|
|
52
59
|
export * from './string/readingTime';
|
|
53
60
|
export * from './string/escape';
|
|
54
61
|
export * from './string/pupa';
|
|
55
|
-
import { JsonStringifyFunction, StringifyAnyOptions
|
|
62
|
+
import type { JsonStringifyFunction, StringifyAnyOptions } from './string/stringifyAny';
|
|
63
|
+
import { _stringifyAny } from './string/stringifyAny';
|
|
56
64
|
export * from './time/time.util';
|
|
57
65
|
export * from './is.util';
|
|
58
|
-
import { Class, ConditionalExcept, ConditionalPick, Merge, Promisable, ReadonlyDeep, Simplify } from './typeFest';
|
|
59
|
-
import { AsyncMapper, AsyncPredicate, BaseDBEntity, CreatedUpdated, CreatedUpdatedId, ObjectWithId, AnyObjectWithId, Saved, Unsaved, UnsavedId, BatchResult, InstanceId, IsoDate, IsoDateString, IsoDateTimeString, KeyValueTuple, Mapper, ObjectMapper, ObjectPredicate, Predicate, PromiseMap, AnyObject, AnyEnum, NumberEnum, StringEnum, AnyFunction, Reviver, SavedDBEntity, StringMap, UnixTimestampNumber, UnixTimestampMillisNumber, UnixTimestamp, Integer, ValueOf, ValuesOf, AbortableMapper, AbortableAsyncPredicate, AbortableAsyncMapper, AbortablePredicate, NullishValue, FalsyValue } from './types';
|
|
66
|
+
import type { Class, ConditionalExcept, ConditionalPick, Merge, Promisable, ReadonlyDeep, Simplify } from './typeFest';
|
|
67
|
+
import type { AsyncMapper, AsyncPredicate, BaseDBEntity, CreatedUpdated, CreatedUpdatedId, ObjectWithId, AnyObjectWithId, Saved, Unsaved, UnsavedId, BatchResult, InstanceId, IsoDate, IsoDateString, IsoDateTimeString, KeyValueTuple, Mapper, ObjectMapper, ObjectPredicate, Predicate, PromiseMap, AnyObject, AnyEnum, NumberEnum, StringEnum, AnyFunction, Reviver, SavedDBEntity, StringMap, UnixTimestampNumber, UnixTimestampMillisNumber, UnixTimestamp, Integer, ValueOf, ValuesOf, AbortableMapper, AbortableAsyncPredicate, AbortableAsyncMapper, AbortablePredicate, NullishValue, FalsyValue } from './types';
|
|
60
68
|
export * from './types';
|
|
61
69
|
export * from './unit/size.util';
|
|
62
70
|
import { is } from './vendor/is';
|
|
63
|
-
import { CommonLogLevel, CommonLogFunction, CommonLogger, CommonLogWithLevelFunction } from './log/commonLogger';
|
|
71
|
+
import type { CommonLogLevel, CommonLogFunction, CommonLogger, CommonLogWithLevelFunction } from './log/commonLogger';
|
|
64
72
|
export * from './log/commonLogger';
|
|
65
73
|
export * from './string/safeJsonStringify';
|
|
66
|
-
import { PQueueCfg } from './promise/pQueue';
|
|
74
|
+
import type { PQueueCfg } from './promise/pQueue';
|
|
67
75
|
export * from './promise/pQueue';
|
|
68
76
|
export * from './seq/seq';
|
|
69
77
|
export * from './math/stack.util';
|
|
@@ -72,9 +80,9 @@ export * from './datetime/localDate';
|
|
|
72
80
|
export * from './datetime/localTime';
|
|
73
81
|
export * from './datetime/dateInterval';
|
|
74
82
|
export * from './datetime/timeInterval';
|
|
75
|
-
import { LocalDateConfig, LocalDateFormatter, LocalDateUnit, LocalDateUnitStrict, Inclusiveness } from './datetime/localDate';
|
|
76
|
-
import { LocalTimeConfig, LocalTimeFormatter, LocalTimeUnit, LocalTimeComponents, ISODayOfWeek } from './datetime/localTime';
|
|
77
|
-
import { DateIntervalConfig, DateIntervalString } from './datetime/dateInterval';
|
|
78
|
-
import { TimeIntervalConfig, TimeIntervalString } from './datetime/timeInterval';
|
|
83
|
+
import type { LocalDateConfig, LocalDateFormatter, LocalDateUnit, LocalDateUnitStrict, Inclusiveness } from './datetime/localDate';
|
|
84
|
+
import type { LocalTimeConfig, LocalTimeFormatter, LocalTimeUnit, LocalTimeComponents, ISODayOfWeek } from './datetime/localTime';
|
|
85
|
+
import type { DateIntervalConfig, DateIntervalString } from './datetime/dateInterval';
|
|
86
|
+
import type { TimeIntervalConfig, TimeIntervalString } from './datetime/timeInterval';
|
|
79
87
|
export type { DateIntervalConfig, DateIntervalString, TimeIntervalConfig, TimeIntervalString, LocalDateConfig, LocalDateFormatter, LocalDateUnit, LocalDateUnitStrict, Inclusiveness, LocalTimeConfig, LocalTimeFormatter, LocalTimeUnit, ISODayOfWeek, LocalTimeComponents, AbortableMapper, AbortablePredicate, AbortableAsyncPredicate, AbortableAsyncMapper, PQueueCfg, MemoCache, AsyncMemoCache, PromiseDecoratorCfg, PromiseDecoratorResp, ErrorData, ErrorObject, HttpErrorData, HttpErrorResponse, Admin401ErrorData, Admin403ErrorData, StringMap, PromiseMap, AnyObject, AnyEnum, NumberEnum, StringEnum, AnyFunction, ValuesOf, ValueOf, KeyValueTuple, ObjectMapper, ObjectPredicate, InstanceId, IsoDate, IsoDateString, IsoDateTimeString, Reviver, FalsyValue, NullishValue, PMapOptions, Mapper, AsyncMapper, Predicate, AsyncPredicate, BatchResult, DeferredPromise, PRetryOptions, PTimeoutOptions, TryCatchOptions, StringifyAnyOptions, JsonStringifyFunction, Merge, ReadonlyDeep, Promisable, Simplify, ConditionalPick, ConditionalExcept, Class, UnixTimestampNumber, UnixTimestampMillisNumber, UnixTimestamp, Integer, BaseDBEntity, SavedDBEntity, Saved, Unsaved, UnsavedId, CreatedUpdated, CreatedUpdatedId, ObjectWithId, AnyObjectWithId, JsonSchema, JsonSchemaAny, JsonSchemaOneOf, JsonSchemaAllOf, JsonSchemaAnyOf, JsonSchemaNot, JsonSchemaRef, JsonSchemaConst, JsonSchemaEnum, JsonSchemaString, JsonSchemaNumber, JsonSchemaBoolean, JsonSchemaNull, JsonSchemaRootObject, JsonSchemaObject, JsonSchemaArray, JsonSchemaTuple, JsonSchemaBuilder, CommonLogLevel, CommonLogWithLevelFunction, CommonLogFunction, CommonLogger, };
|
|
80
88
|
export { is, _createPromiseDecorator, pMap, ErrorMode, pDefer, AggregatedError, pRetry, pRetryFn, pTimeout, pTimeoutFn, _tryCatch, _TryCatch, _stringifyAny, jsonSchema, JsonSchemaAnyBuilder, };
|
package/dist/index.js
CHANGED
|
@@ -84,4 +84,3 @@ tslib_1.__exportStar(require("./datetime/localDate"), exports);
|
|
|
84
84
|
tslib_1.__exportStar(require("./datetime/localTime"), exports);
|
|
85
85
|
tslib_1.__exportStar(require("./datetime/dateInterval"), exports);
|
|
86
86
|
tslib_1.__exportStar(require("./datetime/timeInterval"), exports);
|
|
87
|
-
const localTime_1 = require("./datetime/localTime");
|
package/dist/is.util.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Primitive } from './typeFest';
|
|
2
|
-
import { AnyObject, FalsyValue, NullishValue } from './types';
|
|
1
|
+
import type { Primitive } from './typeFest';
|
|
2
|
+
import type { AnyObject, FalsyValue, NullishValue } from './types';
|
|
3
3
|
declare type Nullish<T> = T extends NullishValue ? T : never;
|
|
4
4
|
declare type Truthy<T> = T extends FalsyValue ? never : T;
|
|
5
5
|
declare type Falsy<T> = T extends FalsyValue ? T : never;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { JsonSchema, JsonSchemaAny, JsonSchemaNumber, JsonSchemaObject, JsonSchemaString } from './jsonSchema.model';
|
|
1
|
+
import type { JsonSchema, JsonSchemaAny, JsonSchemaNumber, JsonSchemaObject, JsonSchemaString } from './jsonSchema.model';
|
|
2
2
|
export declare const JSON_SCHEMA_ORDER: (keyof JsonSchema | keyof JsonSchemaAny | keyof JsonSchemaObject | keyof JsonSchemaString | keyof JsonSchemaNumber)[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject, StringMap } from '../types';
|
|
1
|
+
import type { AnyObject, StringMap } from '../types';
|
|
2
2
|
export declare type JsonSchema<T = unknown> = JsonSchemaAny<T> | JsonSchemaOneOf<T> | JsonSchemaAllOf<T> | JsonSchemaAnyOf<T> | JsonSchemaNot<T> | JsonSchemaRef<T> | JsonSchemaConst<T> | JsonSchemaEnum<T> | JsonSchemaString | JsonSchemaNumber | JsonSchemaBoolean | JsonSchemaNull | JsonSchemaObject<T> | JsonSchemaArray<T> | JsonSchemaTuple<T>;
|
|
3
3
|
export interface JsonSchemaAny<T = unknown> {
|
|
4
4
|
$schema?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { BaseDBEntity, JsonSchemaAllOf, JsonSchemaArray, JsonSchemaOneOf, JsonSchemaTuple, SavedDBEntity, AnyObject } from '../index';
|
|
3
|
-
import { JsonSchema, JsonSchemaAny, JsonSchemaBoolean, JsonSchemaConst, JsonSchemaEnum, JsonSchemaNull, JsonSchemaNumber, JsonSchemaObject, JsonSchemaRef, JsonSchemaString } from './jsonSchema.model';
|
|
2
|
+
import type { BaseDBEntity, JsonSchemaAllOf, JsonSchemaArray, JsonSchemaOneOf, JsonSchemaTuple, SavedDBEntity, AnyObject } from '../index';
|
|
3
|
+
import type { JsonSchema, JsonSchemaAny, JsonSchemaBoolean, JsonSchemaConst, JsonSchemaEnum, JsonSchemaNull, JsonSchemaNumber, JsonSchemaObject, JsonSchemaRef, JsonSchemaString } from './jsonSchema.model';
|
|
4
4
|
export interface JsonSchemaBuilder<T = unknown> {
|
|
5
5
|
build(): JsonSchema<T>;
|
|
6
6
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SavedDBEntity } from '../types';
|
|
1
|
+
import type { SavedDBEntity } from '../types';
|
|
2
2
|
export declare const baseDBEntityJsonSchema: import("./jsonSchemaBuilder").JsonSchemaObjectBuilder<Partial<SavedDBEntity<string>>>;
|
|
3
3
|
export declare const savedDBEntityJsonSchema: import("./jsonSchemaBuilder").JsonSchemaObjectBuilder<SavedDBEntity<string>>;
|
package/dist/lazy.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PropertyPath } from '../lodash.types';
|
|
2
|
-
import { AnyObject, ObjectMapper, ObjectPredicate, StringMap, ValueOf } from '../types';
|
|
1
|
+
import type { PropertyPath } from '../lodash.types';
|
|
2
|
+
import type { AnyObject, ObjectMapper, ObjectPredicate, StringMap, ValueOf } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Returns clone of `obj` with only `props` preserved.
|
|
5
5
|
* Opposite of Omit.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AsyncPredicate } from '../types';
|
|
1
|
+
import type { AsyncPredicate } from '../types';
|
|
2
2
|
export declare function pFilter<T>(iterable: Iterable<T>, filterFn: AsyncPredicate<T>): Promise<T[]>;
|
package/dist/promise/pMap.d.ts
CHANGED
package/dist/promise/pQueue.d.ts
CHANGED
package/dist/promise/pRetry.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppError } from '../error/app.error';
|
|
2
|
-
import { ErrorData } from '../error/error.model';
|
|
3
|
-
import { AnyFunction } from '../types';
|
|
2
|
+
import type { ErrorData } from '../error/error.model';
|
|
3
|
+
import type { AnyFunction } from '../types';
|
|
4
4
|
export declare class TimeoutError extends AppError {
|
|
5
5
|
}
|
|
6
6
|
export interface PTimeoutOptions {
|
package/dist/seq/seq.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AbortableAsyncMapper, AbortableAsyncPredicate, AbortableMapper, AbortablePredicate
|
|
1
|
+
import type { AbortableAsyncMapper, AbortableAsyncPredicate, AbortableMapper, AbortablePredicate } from '../types';
|
|
2
|
+
import { END } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Inspired by Kotlin Sequences.
|
|
4
5
|
* Similar to arrays, but with lazy evaluation, abortable.
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
+
import type { Integer } from '../types';
|
|
1
2
|
export interface ReadingTimeOptions {
|
|
3
|
+
/**
|
|
4
|
+
* A function that returns a boolean value depending on if a character is considered as a word bound.
|
|
5
|
+
* Default: spaces, new lines and tabs
|
|
6
|
+
*/
|
|
2
7
|
wordBound?: (char: string) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Default 200
|
|
10
|
+
*/
|
|
3
11
|
wordsPerMinute?: number;
|
|
4
12
|
}
|
|
5
13
|
export interface ReadingTimeStats {
|
|
6
|
-
|
|
7
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Number of milliseconds.
|
|
16
|
+
*/
|
|
17
|
+
time: Integer;
|
|
18
|
+
minutes: Integer;
|
|
8
19
|
}
|
|
9
20
|
export interface WordCountStats {
|
|
10
21
|
total: number;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Except, Merge, Promisable } from './typeFest';
|
|
1
|
+
import type { Except, Merge, Promisable } from './typeFest';
|
|
2
2
|
/**
|
|
3
3
|
* Map from String to String (or <T>).
|
|
4
4
|
*
|
|
@@ -179,19 +179,17 @@ export declare type Reviver = (this: any, key: string, value: any) => any;
|
|
|
179
179
|
* Needed due to https://github.com/microsoft/TypeScript/issues/13778
|
|
180
180
|
* Only affects typings, no runtime effect.
|
|
181
181
|
*/
|
|
182
|
-
export declare
|
|
182
|
+
export declare const _stringMapValues: <T>(m: StringMap<T>) => T[];
|
|
183
183
|
/**
|
|
184
184
|
* Needed due to https://github.com/microsoft/TypeScript/issues/13778
|
|
185
185
|
* Only affects typings, no runtime effect.
|
|
186
186
|
*/
|
|
187
|
-
export declare
|
|
187
|
+
export declare const _stringMapEntries: <T>(m: StringMap<T>) => [k: string, v: T][];
|
|
188
188
|
/**
|
|
189
189
|
* Like `Object.keys`, but returns keys typed as `keyof T`, not as just `string`.
|
|
190
190
|
* This is how TypeScript should work, actually.
|
|
191
|
-
*
|
|
192
|
-
* @experimental
|
|
193
191
|
*/
|
|
194
|
-
export declare
|
|
192
|
+
export declare const _objectKeys: <T extends AnyObject>(obj: T) => (keyof T)[];
|
|
195
193
|
export declare type NullishValue = null | undefined;
|
|
196
194
|
export declare type FalsyValue = false | '' | 0 | null | undefined;
|
|
197
195
|
/**
|
package/dist/types.js
CHANGED
|
@@ -26,28 +26,17 @@ exports._passNothingPredicate = _passNothingPredicate;
|
|
|
26
26
|
* Needed due to https://github.com/microsoft/TypeScript/issues/13778
|
|
27
27
|
* Only affects typings, no runtime effect.
|
|
28
28
|
*/
|
|
29
|
-
|
|
30
|
-
return Object.values(m);
|
|
31
|
-
}
|
|
32
|
-
exports._stringMapValues = _stringMapValues;
|
|
29
|
+
exports._stringMapValues = Object.values;
|
|
33
30
|
/**
|
|
34
31
|
* Needed due to https://github.com/microsoft/TypeScript/issues/13778
|
|
35
32
|
* Only affects typings, no runtime effect.
|
|
36
33
|
*/
|
|
37
|
-
|
|
38
|
-
return Object.entries(m);
|
|
39
|
-
}
|
|
40
|
-
exports._stringMapEntries = _stringMapEntries;
|
|
34
|
+
exports._stringMapEntries = Object.entries;
|
|
41
35
|
/**
|
|
42
36
|
* Like `Object.keys`, but returns keys typed as `keyof T`, not as just `string`.
|
|
43
37
|
* This is how TypeScript should work, actually.
|
|
44
|
-
*
|
|
45
|
-
* @experimental
|
|
46
38
|
*/
|
|
47
|
-
|
|
48
|
-
return Object.keys(obj);
|
|
49
|
-
}
|
|
50
|
-
exports._objectKeys = _objectKeys;
|
|
39
|
+
exports._objectKeys = Object.keys;
|
|
51
40
|
/**
|
|
52
41
|
* Utility function that helps to cast *existing variable* to needed type T.
|
|
53
42
|
*
|
package/dist-esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export * from './array/array.util';
|
|
|
2
2
|
export * from './lazy';
|
|
3
3
|
export * from './string/url.util';
|
|
4
4
|
export * from './array/range';
|
|
5
|
-
import { _createPromiseDecorator
|
|
5
|
+
import { _createPromiseDecorator } from './decorators/createPromiseDecorator';
|
|
6
6
|
export * from './decorators/debounce';
|
|
7
7
|
export * from './decorators/debounce.decorator';
|
|
8
8
|
export * from './decorators/decorator.util';
|
|
@@ -24,7 +24,7 @@ import { _TryCatch, _tryCatch } from './error/tryCatch';
|
|
|
24
24
|
export * from './json-schema/from-data/generateJsonSchemaFromData';
|
|
25
25
|
export * from './json-schema/jsonSchema.cnst';
|
|
26
26
|
export * from './json-schema/jsonSchema.util';
|
|
27
|
-
import { jsonSchema, JsonSchemaAnyBuilder
|
|
27
|
+
import { jsonSchema, JsonSchemaAnyBuilder } from './json-schema/jsonSchemaBuilder';
|
|
28
28
|
export * from './math/math.util';
|
|
29
29
|
export * from './math/sma';
|
|
30
30
|
export * from './number/createDeterministicRandom';
|
|
@@ -65,5 +65,4 @@ export * from './datetime/localDate';
|
|
|
65
65
|
export * from './datetime/localTime';
|
|
66
66
|
export * from './datetime/dateInterval';
|
|
67
67
|
export * from './datetime/timeInterval';
|
|
68
|
-
import { ISODayOfWeek, } from './datetime/localTime';
|
|
69
68
|
export { is, _createPromiseDecorator, pMap, ErrorMode, pDefer, AggregatedError, pRetry, pRetryFn, pTimeout, pTimeoutFn, _tryCatch, _TryCatch, _stringifyAny, jsonSchema, JsonSchemaAnyBuilder, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _uniq } from '../array/array.util';
|
|
2
|
-
import { mergeJsonSchemaObjects, _deepCopy, _sortObject
|
|
2
|
+
import { mergeJsonSchemaObjects, _deepCopy, _sortObject } from '../index';
|
|
3
3
|
import { JSON_SCHEMA_ORDER } from './jsonSchema.cnst';
|
|
4
4
|
/**
|
|
5
5
|
* Fluent (chainable) API to manually create Json Schemas.
|
package/dist-esm/seq/seq.js
CHANGED