@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.
Files changed (101) hide show
  1. package/dist/array/array.util.d.ts +2 -2
  2. package/dist/datetime/dateInterval.d.ts +2 -1
  3. package/dist/datetime/localDate.d.ts +1 -1
  4. package/dist/datetime/localTime.d.ts +3 -2
  5. package/dist/datetime/timeInterval.d.ts +4 -3
  6. package/dist/decorators/asyncMemo.decorator.d.ts +2 -2
  7. package/dist/decorators/debounce.d.ts +1 -1
  8. package/dist/decorators/debounce.decorator.d.ts +1 -1
  9. package/dist/decorators/decorator.util.d.ts +1 -1
  10. package/dist/decorators/logMethod.decorator.d.ts +1 -1
  11. package/dist/decorators/memo.decorator.d.ts +2 -2
  12. package/dist/decorators/memo.util.d.ts +1 -1
  13. package/dist/decorators/memoFn.d.ts +2 -2
  14. package/dist/decorators/memoFnAsync.d.ts +2 -2
  15. package/dist/decorators/memoSimple.decorator.d.ts +1 -1
  16. package/dist/decorators/retry.decorator.d.ts +1 -1
  17. package/dist/decorators/timeout.decorator.d.ts +1 -1
  18. package/dist/enum.util.d.ts +1 -1
  19. package/dist/error/app.error.d.ts +1 -1
  20. package/dist/error/assert.d.ts +1 -1
  21. package/dist/error/error.util.d.ts +2 -1
  22. package/dist/error/http.error.d.ts +1 -1
  23. package/dist/error/try.d.ts +1 -1
  24. package/dist/error/tryCatch.d.ts +2 -2
  25. package/dist/index.d.ts +27 -19
  26. package/dist/index.js +0 -1
  27. package/dist/is.util.d.ts +2 -2
  28. package/dist/json-schema/from-data/generateJsonSchemaFromData.d.ts +1 -1
  29. package/dist/json-schema/jsonSchema.cnst.d.ts +1 -1
  30. package/dist/json-schema/jsonSchema.model.d.ts +1 -1
  31. package/dist/json-schema/jsonSchema.util.d.ts +1 -1
  32. package/dist/json-schema/jsonSchemaBuilder.d.ts +2 -2
  33. package/dist/json-schema/jsonSchemas.d.ts +1 -1
  34. package/dist/lazy.d.ts +1 -1
  35. package/dist/object/object.util.d.ts +2 -2
  36. package/dist/object/sortObject.d.ts +1 -1
  37. package/dist/promise/pFilter.d.ts +1 -1
  38. package/dist/promise/pMap.d.ts +2 -1
  39. package/dist/promise/pQueue.d.ts +1 -1
  40. package/dist/promise/pRetry.d.ts +1 -1
  41. package/dist/promise/pTimeout.d.ts +2 -2
  42. package/dist/seq/seq.d.ts +2 -1
  43. package/dist/string/readingTime.d.ts +13 -2
  44. package/dist/string/safeJsonStringify.d.ts +1 -1
  45. package/dist/string/stringifyAny.d.ts +1 -1
  46. package/dist/string/url.util.d.ts +1 -1
  47. package/dist/types.d.ts +4 -6
  48. package/dist/types.js +3 -14
  49. package/dist-esm/error/error.util.js +1 -1
  50. package/dist-esm/index.js +2 -3
  51. package/dist-esm/json-schema/from-data/generateJsonSchemaFromData.js +1 -1
  52. package/dist-esm/json-schema/jsonSchemaBuilder.js +1 -1
  53. package/dist-esm/seq/seq.js +1 -1
  54. package/dist-esm/types.js +3 -11
  55. package/package.json +2 -4
  56. package/src/array/array.util.ts +2 -2
  57. package/src/datetime/dateInterval.ts +2 -1
  58. package/src/datetime/localDate.ts +1 -1
  59. package/src/datetime/localTime.ts +3 -2
  60. package/src/datetime/timeInterval.ts +4 -3
  61. package/src/decorators/asyncMemo.decorator.ts +4 -3
  62. package/src/decorators/debounce.decorator.ts +2 -1
  63. package/src/decorators/debounce.ts +1 -1
  64. package/src/decorators/decorator.util.ts +1 -1
  65. package/src/decorators/logMethod.decorator.ts +2 -1
  66. package/src/decorators/memo.decorator.ts +4 -3
  67. package/src/decorators/memo.util.ts +1 -1
  68. package/src/decorators/memoFn.ts +3 -2
  69. package/src/decorators/memoFnAsync.ts +3 -2
  70. package/src/decorators/memoSimple.decorator.ts +3 -2
  71. package/src/decorators/retry.decorator.ts +2 -1
  72. package/src/decorators/timeout.decorator.ts +2 -1
  73. package/src/enum.util.ts +1 -1
  74. package/src/error/app.error.ts +1 -1
  75. package/src/error/assert.ts +2 -1
  76. package/src/error/error.util.ts +2 -4
  77. package/src/error/http.error.ts +1 -1
  78. package/src/error/try.ts +1 -1
  79. package/src/error/tryCatch.ts +3 -2
  80. package/src/index.ts +27 -27
  81. package/src/is.util.ts +2 -2
  82. package/src/json-schema/from-data/generateJsonSchemaFromData.ts +2 -3
  83. package/src/json-schema/jsonSchema.cnst.ts +1 -1
  84. package/src/json-schema/jsonSchema.model.ts +1 -1
  85. package/src/json-schema/jsonSchema.util.ts +1 -1
  86. package/src/json-schema/jsonSchemaBuilder.ts +3 -5
  87. package/src/json-schema/jsonSchemas.ts +1 -1
  88. package/src/lazy.ts +1 -1
  89. package/src/object/object.util.ts +2 -2
  90. package/src/object/sortObject.ts +2 -1
  91. package/src/promise/pFilter.ts +1 -1
  92. package/src/promise/pMap.ts +2 -1
  93. package/src/promise/pQueue.ts +3 -2
  94. package/src/promise/pRetry.ts +2 -1
  95. package/src/promise/pTimeout.ts +2 -2
  96. package/src/seq/seq.ts +2 -3
  97. package/src/string/readingTime.ts +14 -2
  98. package/src/string/safeJsonStringify.ts +1 -1
  99. package/src/string/stringifyAny.ts +1 -1
  100. package/src/string/url.util.ts +1 -1
  101. package/src/types.ts +4 -12
package/dist-esm/types.js CHANGED
@@ -18,25 +18,17 @@ export const _passNothingPredicate = () => false;
18
18
  * Needed due to https://github.com/microsoft/TypeScript/issues/13778
19
19
  * Only affects typings, no runtime effect.
20
20
  */
21
- export function _stringMapValues(m) {
22
- return Object.values(m);
23
- }
21
+ export const _stringMapValues = Object.values;
24
22
  /**
25
23
  * Needed due to https://github.com/microsoft/TypeScript/issues/13778
26
24
  * Only affects typings, no runtime effect.
27
25
  */
28
- export function _stringMapEntries(m) {
29
- return Object.entries(m);
30
- }
26
+ export const _stringMapEntries = Object.entries;
31
27
  /**
32
28
  * Like `Object.keys`, but returns keys typed as `keyof T`, not as just `string`.
33
29
  * This is how TypeScript should work, actually.
34
- *
35
- * @experimental
36
30
  */
37
- export function _objectKeys(obj) {
38
- return Object.keys(obj);
39
- }
31
+ export const _objectKeys = Object.keys;
40
32
  /**
41
33
  * Utility function that helps to cast *existing variable* to needed type T.
42
34
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/js-lib",
3
- "version": "14.108.0",
3
+ "version": "14.109.1",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "build-prod": "build-prod-esm-cjs",
@@ -18,12 +18,10 @@
18
18
  "@types/node": "^18.0.0",
19
19
  "expect-type": "^0.13.0",
20
20
  "jest": "^28.0.3",
21
- "patch-package": "^6.2.1",
22
21
  "prettier": "^2.1.2",
23
22
  "rxjs": "^7.0.1",
24
23
  "vuepress": "^1.7.1",
25
- "vuepress-plugin-typescript": "^0.3.1",
26
- "weak-napi": "^2.0.2"
24
+ "vuepress-plugin-typescript": "^0.3.1"
27
25
  },
28
26
  "files": [
29
27
  "dist",
@@ -1,6 +1,6 @@
1
1
  import { _isNotNullish } from '../is.util'
2
- import { RecursiveArray } from '../lodash.types'
3
- import { FalsyValue, Mapper, Predicate, StringMap } from '../types'
2
+ import type { RecursiveArray } from '../lodash.types'
3
+ import type { FalsyValue, Mapper, Predicate, StringMap } from '../types'
4
4
 
5
5
  /**
6
6
  * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the
@@ -1,4 +1,5 @@
1
- import { Inclusiveness, LocalDate, LocalDateConfig, LocalDateUnit } from './localDate'
1
+ import type { Inclusiveness, LocalDateConfig, LocalDateUnit } from './localDate'
2
+ import { LocalDate } from './localDate'
2
3
 
3
4
  export type DateIntervalConfig = DateInterval | DateIntervalString
4
5
  export type DateIntervalString = string
@@ -1,5 +1,5 @@
1
1
  import { _assert } from '../error/assert'
2
- import {
2
+ import type {
3
3
  IsoDateString,
4
4
  IsoDateTimeString,
5
5
  UnixTimestampMillisNumber,
@@ -1,12 +1,13 @@
1
1
  import { _assert } from '../error/assert'
2
2
  import { _ms } from '../time/time.util'
3
- import {
3
+ import type {
4
4
  IsoDateString,
5
5
  IsoDateTimeString,
6
6
  UnixTimestampMillisNumber,
7
7
  UnixTimestampNumber,
8
8
  } from '../types'
9
- import { Inclusiveness, LocalDate } from './localDate'
9
+ import type { Inclusiveness } from './localDate'
10
+ import { LocalDate } from './localDate'
10
11
 
11
12
  export type LocalTimeUnit = 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second'
12
13
 
@@ -1,6 +1,7 @@
1
- import { UnixTimestampNumber } from '../types'
2
- import { Inclusiveness } from './localDate'
3
- import { LocalTime, LocalTimeConfig } from './localTime'
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
 
5
6
  export type TimeIntervalConfig = TimeInterval | TimeIntervalString
6
7
  export type TimeIntervalString = string
@@ -1,8 +1,9 @@
1
- import { CommonLogger } from '../log/commonLogger'
1
+ import type { CommonLogger } from '../log/commonLogger'
2
2
  import { _since } from '../time/time.util'
3
- import { AnyObject } from '../types'
3
+ import type { AnyObject } from '../types'
4
4
  import { _getArgsSignature, _getMethodSignature, _getTargetMethodSignature } from './decorator.util'
5
- import { AsyncMemoCache, jsonMemoSerializer, MapMemoCache } from './memo.util'
5
+ import type { AsyncMemoCache } from './memo.util'
6
+ import { jsonMemoSerializer, MapMemoCache } from './memo.util'
6
7
 
7
8
  export interface AsyncMemoOptions {
8
9
  /**
@@ -1,4 +1,5 @@
1
- import { DebounceOptions, ThrottleOptions, _debounce, _throttle } from './debounce'
1
+ import type { DebounceOptions, ThrottleOptions } from './debounce'
2
+ import { _debounce, _throttle } from './debounce'
2
3
 
3
4
  // eslint-disable-next-line @typescript-eslint/naming-convention
4
5
  export function _Debounce(wait: number, opt: DebounceOptions = {}): MethodDecorator {
@@ -1,4 +1,4 @@
1
- import { AnyFunction } from '../types'
1
+ import type { AnyFunction } from '../types'
2
2
 
3
3
  export interface Cancelable {
4
4
  cancel(): void
@@ -1,4 +1,4 @@
1
- import { AnyObject, InstanceId } from '../index'
1
+ import type { AnyObject, InstanceId } from '../index'
2
2
 
3
3
  /**
4
4
  * @returns
@@ -1,4 +1,5 @@
1
- import { SimpleMovingAverage, _stringifyAny, CommonLogger, _assert } from '..'
1
+ import type { CommonLogger } from '..'
2
+ import { SimpleMovingAverage, _stringifyAny, _assert } from '..'
2
3
  import { _ms } from '../time/time.util'
3
4
  import { _getArgsSignature, _getMethodSignature } from './decorator.util'
4
5
 
@@ -1,8 +1,9 @@
1
- import { CommonLogger } from '../log/commonLogger'
1
+ import type { CommonLogger } from '../log/commonLogger'
2
2
  import { _since } from '../time/time.util'
3
- import { AnyObject } from '../types'
3
+ import type { AnyObject } from '../types'
4
4
  import { _getArgsSignature, _getMethodSignature, _getTargetMethodSignature } from './decorator.util'
5
- import { jsonMemoSerializer, MapMemoCache, MemoCache } from './memo.util'
5
+ import type { MemoCache } from './memo.util'
6
+ import { jsonMemoSerializer, MapMemoCache } from './memo.util'
6
7
 
7
8
  export interface MemoOptions {
8
9
  /**
@@ -1,5 +1,5 @@
1
1
  import { _isPrimitive } from '..'
2
- import { Promisable } from '../typeFest'
2
+ import type { Promisable } from '../typeFest'
3
3
 
4
4
  export type MemoSerializer = (args: any[]) => any
5
5
 
@@ -1,7 +1,8 @@
1
1
  import { _since } from '../time/time.util'
2
2
  import { _getArgsSignature } from './decorator.util'
3
- import { MemoOptions } from './memo.decorator'
4
- import { jsonMemoSerializer, MapMemoCache, MemoCache } from './memo.util'
3
+ import type { MemoOptions } from './memo.decorator'
4
+ import type { MemoCache } from './memo.util'
5
+ import { jsonMemoSerializer, MapMemoCache } from './memo.util'
5
6
 
6
7
  export interface MemoizedFunction {
7
8
  cache: MemoCache
@@ -1,7 +1,8 @@
1
1
  import { _since } from '../time/time.util'
2
- import { AsyncMemoOptions } from './asyncMemo.decorator'
2
+ import type { AsyncMemoOptions } from './asyncMemo.decorator'
3
3
  import { _getArgsSignature } from './decorator.util'
4
- import { AsyncMemoCache, jsonMemoSerializer, MapMemoCache } from './memo.util'
4
+ import type { AsyncMemoCache } from './memo.util'
5
+ import { jsonMemoSerializer, MapMemoCache } from './memo.util'
5
6
 
6
7
  export interface MemoizedAsyncFunction {
7
8
  cache: AsyncMemoCache
@@ -11,9 +11,10 @@ Otherwise resorts to JSON.stringify.
11
11
  Benchmark shows similar perf for ObjectCache and MapCache.
12
12
  */
13
13
 
14
- import { CommonLogger } from '../log/commonLogger'
14
+ import type { CommonLogger } from '../log/commonLogger'
15
15
  import { _getArgsSignature, _getTargetMethodSignature } from './decorator.util'
16
- import { jsonMemoSerializer, MapMemoCache, MemoCache } from './memo.util'
16
+ import type { MemoCache } from './memo.util'
17
+ import { jsonMemoSerializer, MapMemoCache } from './memo.util'
17
18
 
18
19
  export interface MemoOpts {
19
20
  logHit?: boolean
@@ -1,4 +1,5 @@
1
- import { pRetryFn, PRetryOptions } from '..'
1
+ import type { PRetryOptions } from '..'
2
+ import { pRetryFn } from '..'
2
3
 
3
4
  // eslint-disable-next-line @typescript-eslint/naming-convention
4
5
  export function _Retry(opt: PRetryOptions = {}): MethodDecorator {
@@ -1,5 +1,6 @@
1
1
  import { _assert } from '../error/assert'
2
- import { pTimeout, PTimeoutOptions } from '../promise/pTimeout'
2
+ import type { PTimeoutOptions } from '../promise/pTimeout'
3
+ import { pTimeout } from '../promise/pTimeout'
3
4
  import { _getMethodSignature } from './decorator.util'
4
5
 
5
6
  // eslint-disable-next-line @typescript-eslint/naming-convention
package/src/enum.util.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { NumberEnum, StringEnum } from './types'
1
+ import type { NumberEnum, StringEnum } from './types'
2
2
 
3
3
  /**
4
4
  * Returns all number keys of a number-enum.
@@ -1,4 +1,4 @@
1
- import { ErrorData } from './error.model'
1
+ import type { ErrorData } from './error.model'
2
2
 
3
3
  /**
4
4
  * Base class for all our (not system) errors.
@@ -1,4 +1,5 @@
1
- import { ErrorData, _deepEquals, _stringifyAny } from '..'
1
+ import type { ErrorData } from '..'
2
+ import { _deepEquals, _stringifyAny } from '..'
2
3
  import { AppError } from './app.error'
3
4
 
4
5
  /**
@@ -1,14 +1,12 @@
1
- import {
2
- AppError,
1
+ import type {
3
2
  ErrorData,
4
3
  ErrorObject,
5
4
  HttpErrorData,
6
5
  HttpErrorResponse,
7
6
  StringifyAnyOptions,
8
- _jsonParseIfPossible,
9
- _stringifyAny,
10
7
  Class,
11
8
  } from '..'
9
+ import { AppError, _jsonParseIfPossible, _stringifyAny } from '..'
12
10
 
13
11
  /**
14
12
  * Useful to ensure that error in `catch (err) { ... }`
@@ -1,5 +1,5 @@
1
1
  import { AppError } from './app.error'
2
- import { HttpErrorData } from './error.model'
2
+ import type { HttpErrorData } from './error.model'
3
3
 
4
4
  /**
5
5
  * Base class for HTTP errors - errors that define HTTP error code.
package/src/error/try.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AnyFunction } from '../types'
1
+ import type { AnyFunction } from '../types'
2
2
  import { AppError } from './app.error'
3
3
 
4
4
  /**
@@ -1,5 +1,6 @@
1
- import { _anyToError, _since, _stringifyAny, CommonLogger } from '../index'
2
- import { AnyFunction } from '../types'
1
+ import type { CommonLogger } from '../index'
2
+ import { _anyToError, _since, _stringifyAny } from '../index'
3
+ import type { AnyFunction } from '../types'
3
4
 
4
5
  export interface TryCatchOptions {
5
6
  /**
package/src/index.ts CHANGED
@@ -2,18 +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 {
6
- PromiseDecoratorCfg,
7
- PromiseDecoratorResp,
8
- _createPromiseDecorator,
9
- } from './decorators/createPromiseDecorator'
5
+ import type { PromiseDecoratorCfg, PromiseDecoratorResp } from './decorators/createPromiseDecorator'
6
+ import { _createPromiseDecorator } from './decorators/createPromiseDecorator'
10
7
  export * from './decorators/debounce'
11
8
  export * from './decorators/debounce.decorator'
12
9
  export * from './decorators/decorator.util'
13
10
  export * from './decorators/logMethod.decorator'
14
11
  export * from './decorators/memo.decorator'
15
12
  export * from './decorators/asyncMemo.decorator'
16
- import { MemoCache, AsyncMemoCache } from './decorators/memo.util'
13
+ import type { MemoCache, AsyncMemoCache } from './decorators/memo.util'
17
14
  export * from './decorators/memoFn'
18
15
  export * from './decorators/memoFnAsync'
19
16
  export * from './decorators/retry.decorator'
@@ -21,7 +18,7 @@ export * from './decorators/timeout.decorator'
21
18
  export * from './error/app.error'
22
19
  export * from './error/assert'
23
20
  export * from './enum.util'
24
- import {
21
+ import type {
25
22
  Admin401ErrorData,
26
23
  Admin403ErrorData,
27
24
  ErrorData,
@@ -33,10 +30,11 @@ export * from './error/error.util'
33
30
  import { ErrorMode } from './error/errorMode'
34
31
  export * from './error/http.error'
35
32
  export * from './error/try'
36
- import { TryCatchOptions, _TryCatch, _tryCatch } from './error/tryCatch'
33
+ import type { TryCatchOptions } from './error/tryCatch'
34
+ import { _TryCatch, _tryCatch } from './error/tryCatch'
37
35
  export * from './json-schema/from-data/generateJsonSchemaFromData'
38
36
  export * from './json-schema/jsonSchema.cnst'
39
- import {
37
+ import type {
40
38
  JsonSchema,
41
39
  JsonSchemaAllOf,
42
40
  JsonSchemaAny,
@@ -56,11 +54,8 @@ import {
56
54
  JsonSchemaTuple,
57
55
  } from './json-schema/jsonSchema.model'
58
56
  export * from './json-schema/jsonSchema.util'
59
- import {
60
- jsonSchema,
61
- JsonSchemaAnyBuilder,
62
- JsonSchemaBuilder,
63
- } from './json-schema/jsonSchemaBuilder'
57
+ import type { JsonSchemaBuilder } from './json-schema/jsonSchemaBuilder'
58
+ import { jsonSchema, JsonSchemaAnyBuilder } from './json-schema/jsonSchemaBuilder'
64
59
  export * from './math/math.util'
65
60
  export * from './math/sma'
66
61
  export * from './number/createDeterministicRandom'
@@ -70,26 +65,31 @@ export * from './object/object.util'
70
65
  export * from './object/sortObject'
71
66
  export * from './object/sortObjectDeep'
72
67
  import { AggregatedError } from './promise/AggregatedError'
73
- import { DeferredPromise, pDefer } from './promise/pDefer'
68
+ import type { DeferredPromise } from './promise/pDefer'
69
+ import { pDefer } from './promise/pDefer'
74
70
  export * from './promise/pDelay'
75
71
  export * from './promise/pFilter'
76
72
  export * from './promise/pHang'
77
- import { pMap, PMapOptions } from './promise/pMap'
73
+ import type { PMapOptions } from './promise/pMap'
74
+ import { pMap } from './promise/pMap'
78
75
  export * from './promise/pProps'
79
- import { pRetry, pRetryFn, PRetryOptions } from './promise/pRetry'
76
+ import type { PRetryOptions } from './promise/pRetry'
77
+ import { pRetry, pRetryFn } from './promise/pRetry'
80
78
  export * from './promise/pState'
81
- import { pTimeout, pTimeoutFn, PTimeoutOptions } from './promise/pTimeout'
79
+ import type { PTimeoutOptions } from './promise/pTimeout'
80
+ import { pTimeout, pTimeoutFn } from './promise/pTimeout'
82
81
  export * from './string/case'
83
82
  export * from './string/json.util'
84
83
  export * from './string/string.util'
85
84
  export * from './string/readingTime'
86
85
  export * from './string/escape'
87
86
  export * from './string/pupa'
88
- import { JsonStringifyFunction, StringifyAnyOptions, _stringifyAny } from './string/stringifyAny'
87
+ import type { JsonStringifyFunction, StringifyAnyOptions } from './string/stringifyAny'
88
+ import { _stringifyAny } from './string/stringifyAny'
89
89
  export * from './time/time.util'
90
90
  export * from './is.util'
91
91
 
92
- import {
92
+ import type {
93
93
  Class,
94
94
  ConditionalExcept,
95
95
  ConditionalPick,
@@ -98,7 +98,7 @@ import {
98
98
  ReadonlyDeep,
99
99
  Simplify,
100
100
  } from './typeFest'
101
- import {
101
+ import type {
102
102
  AsyncMapper,
103
103
  AsyncPredicate,
104
104
  BaseDBEntity,
@@ -144,7 +144,7 @@ import {
144
144
  export * from './types'
145
145
  export * from './unit/size.util'
146
146
  import { is } from './vendor/is'
147
- import {
147
+ import type {
148
148
  CommonLogLevel,
149
149
  CommonLogFunction,
150
150
  CommonLogger,
@@ -152,7 +152,7 @@ import {
152
152
  } from './log/commonLogger'
153
153
  export * from './log/commonLogger'
154
154
  export * from './string/safeJsonStringify'
155
- import { PQueueCfg } from './promise/pQueue'
155
+ import type { PQueueCfg } from './promise/pQueue'
156
156
  export * from './promise/pQueue'
157
157
  export * from './seq/seq'
158
158
  export * from './math/stack.util'
@@ -161,22 +161,22 @@ export * from './datetime/localDate'
161
161
  export * from './datetime/localTime'
162
162
  export * from './datetime/dateInterval'
163
163
  export * from './datetime/timeInterval'
164
- import {
164
+ import type {
165
165
  LocalDateConfig,
166
166
  LocalDateFormatter,
167
167
  LocalDateUnit,
168
168
  LocalDateUnitStrict,
169
169
  Inclusiveness,
170
170
  } from './datetime/localDate'
171
- import {
171
+ import type {
172
172
  LocalTimeConfig,
173
173
  LocalTimeFormatter,
174
174
  LocalTimeUnit,
175
175
  LocalTimeComponents,
176
176
  ISODayOfWeek,
177
177
  } from './datetime/localTime'
178
- import { DateIntervalConfig, DateIntervalString } from './datetime/dateInterval'
179
- import { TimeIntervalConfig, TimeIntervalString } from './datetime/timeInterval'
178
+ import type { DateIntervalConfig, DateIntervalString } from './datetime/dateInterval'
179
+ import type { TimeIntervalConfig, TimeIntervalString } from './datetime/timeInterval'
180
180
 
181
181
  export type {
182
182
  DateIntervalConfig,
package/src/is.util.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
 
4
4
  type Nullish<T> = T extends NullishValue ? T : never
5
5
  type Truthy<T> = T extends FalsyValue ? never : T
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  JsonSchema,
3
3
  JsonSchemaArray,
4
4
  JsonSchemaBoolean,
@@ -8,10 +8,9 @@ import {
8
8
  JsonSchemaOneOf,
9
9
  JsonSchemaString,
10
10
  StringMap,
11
- _stringMapEntries,
12
- _uniq,
13
11
  AnyObject,
14
12
  } from '../..'
13
+ import { _stringMapEntries, _uniq } from '../..'
15
14
 
16
15
  type PrimitiveType = 'undefined' | 'null' | 'boolean' | 'string' | 'number'
17
16
  type Type = PrimitiveType | 'array' | 'object'
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  JsonSchema,
3
3
  JsonSchemaAny,
4
4
  JsonSchemaNumber,
@@ -1,4 +1,4 @@
1
- import { AnyObject, StringMap } from '../types'
1
+ import type { AnyObject, StringMap } from '../types'
2
2
 
3
3
  // eslint-disable-next-line unused-imports/no-unused-vars
4
4
  export type JsonSchema<T = unknown> =
@@ -1,6 +1,6 @@
1
1
  import { _uniq } from '../index'
2
2
  import { _filterNullishValues } from '../object/object.util'
3
- import { JsonSchemaObject } from './jsonSchema.model'
3
+ import type { JsonSchemaObject } from './jsonSchema.model'
4
4
 
5
5
  /**
6
6
  * Merges s2 into s1 (mutates s1) and returns s1.
@@ -1,18 +1,16 @@
1
1
  import { _uniq } from '../array/array.util'
2
- import {
2
+ import type {
3
3
  BaseDBEntity,
4
4
  JsonSchemaAllOf,
5
5
  JsonSchemaArray,
6
6
  JsonSchemaOneOf,
7
7
  JsonSchemaTuple,
8
- mergeJsonSchemaObjects,
9
8
  SavedDBEntity,
10
- _deepCopy,
11
- _sortObject,
12
9
  AnyObject,
13
10
  } from '../index'
11
+ import { mergeJsonSchemaObjects, _deepCopy, _sortObject } from '../index'
14
12
  import { JSON_SCHEMA_ORDER } from './jsonSchema.cnst'
15
- import {
13
+ import type {
16
14
  JsonSchema,
17
15
  JsonSchemaAny,
18
16
  JsonSchemaBoolean,
@@ -1,4 +1,4 @@
1
- import { BaseDBEntity, SavedDBEntity } from '../types'
1
+ import type { BaseDBEntity, SavedDBEntity } from '../types'
2
2
  import { jsonSchema } from './jsonSchemaBuilder'
3
3
 
4
4
  export const baseDBEntityJsonSchema = jsonSchema.object<BaseDBEntity>({
package/src/lazy.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AnyFunction, AnyObject } from './types'
1
+ import type { AnyFunction, AnyObject } from './types'
2
2
 
3
3
  /**
4
4
  * const value = lazyValue(() => expensiveComputation())
@@ -1,6 +1,6 @@
1
1
  import { _isEmpty, _isObject } from '../is.util'
2
- import { PropertyPath } from '../lodash.types'
3
- import { AnyObject, ObjectMapper, ObjectPredicate, StringMap, ValueOf } from '../types'
2
+ import type { PropertyPath } from '../lodash.types'
3
+ import type { AnyObject, ObjectMapper, ObjectPredicate, StringMap, ValueOf } from '../types'
4
4
 
5
5
  /**
6
6
  * Returns clone of `obj` with only `props` preserved.
@@ -1,4 +1,5 @@
1
- import { _omit, AnyObject } from '../index'
1
+ import type { AnyObject } from '../index'
2
+ import { _omit } from '../index'
2
3
 
3
4
  /**
4
5
  * Returns new object with keys sorder in the given order.
@@ -1,4 +1,4 @@
1
- import { AsyncPredicate } from '../types'
1
+ import type { AsyncPredicate } from '../types'
2
2
 
3
3
  export async function pFilter<T>(iterable: Iterable<T>, filterFn: AsyncPredicate<T>): Promise<T[]> {
4
4
  const items = [...iterable]
@@ -7,7 +7,8 @@ Improvements:
7
7
  - Compatible with pProps (that had typings issues)
8
8
  */
9
9
 
10
- import { AbortableAsyncMapper, END, ErrorMode, SKIP } from '..'
10
+ import type { AbortableAsyncMapper } from '..'
11
+ import { END, ErrorMode, SKIP } from '..'
11
12
  import { AggregatedError } from './AggregatedError'
12
13
 
13
14
  export interface PMapOptions {
@@ -1,6 +1,7 @@
1
1
  import { ErrorMode } from '../error/errorMode'
2
- import { CommonLogger } from '../log/commonLogger'
3
- import { DeferredPromise, pDefer } from './pDefer'
2
+ import type { CommonLogger } from '../log/commonLogger'
3
+ import type { DeferredPromise } from './pDefer'
4
+ import { pDefer } from './pDefer'
4
5
 
5
6
  export interface PQueueCfg {
6
7
  concurrency: number
@@ -1,4 +1,5 @@
1
- import { _since, _stringifyAny, AnyFunction, AppError, CommonLogger, ErrorData } from '..'
1
+ import type { AnyFunction, AppError, CommonLogger, ErrorData } from '..'
2
+ import { _since, _stringifyAny } from '..'
2
3
  import { TimeoutError } from './pTimeout'
3
4
 
4
5
  export interface PRetryOptions {
@@ -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
 
5
5
  export class TimeoutError extends AppError {}
6
6
 
package/src/seq/seq.ts CHANGED
@@ -1,11 +1,10 @@
1
- import {
1
+ import type {
2
2
  AbortableAsyncMapper,
3
3
  AbortableAsyncPredicate,
4
4
  AbortableMapper,
5
5
  AbortablePredicate,
6
- END,
7
- SKIP,
8
6
  } from '../types'
7
+ import { END, SKIP } from '../types'
9
8
 
10
9
  /**
11
10
  * Inspired by Kotlin Sequences.