@naturalcycles/js-lib 15.15.1 → 15.16.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.
Files changed (107) hide show
  1. package/dist/array/range.d.ts +1 -2
  2. package/dist/bot.model.d.ts +12 -0
  3. package/dist/bot.model.js +15 -0
  4. package/dist/browser/adminService.d.ts +1 -1
  5. package/dist/{bot.d.ts → browser/bot.d.ts} +1 -12
  6. package/dist/{bot.js → browser/bot.js} +2 -16
  7. package/dist/browser/index.d.ts +8 -0
  8. package/dist/browser/index.js +8 -0
  9. package/dist/datetime/index.d.ts +6 -0
  10. package/dist/datetime/index.js +6 -0
  11. package/dist/datetime/localTime.js +1 -1
  12. package/dist/decorators/decorator.util.d.ts +1 -1
  13. package/dist/decorators/index.d.ts +12 -0
  14. package/dist/decorators/index.js +12 -0
  15. package/dist/decorators/logMethod.decorator.d.ts +1 -1
  16. package/dist/decorators/logMethod.decorator.js +4 -2
  17. package/dist/decorators/retry.decorator.d.ts +1 -1
  18. package/dist/decorators/retry.decorator.js +1 -1
  19. package/dist/error/assert.d.ts +1 -2
  20. package/dist/error/error.util.d.ts +2 -1
  21. package/dist/error/index.d.ts +6 -0
  22. package/dist/error/index.js +6 -0
  23. package/dist/error/try.d.ts +1 -2
  24. package/dist/error/tryCatch.d.ts +1 -1
  25. package/dist/error/tryCatch.js +2 -1
  26. package/dist/http/fetcher.js +1 -1
  27. package/dist/http/fetcher.model.d.ts +1 -2
  28. package/dist/http/index.d.ts +3 -0
  29. package/dist/http/index.js +2 -0
  30. package/dist/index.d.ts +0 -80
  31. package/dist/index.js +0 -80
  32. package/dist/is.util.d.ts +1 -2
  33. package/dist/iter/asyncIterable2.d.ts +1 -2
  34. package/dist/json-schema/from-data/generateJsonSchemaFromData.d.ts +2 -1
  35. package/dist/json-schema/from-data/generateJsonSchemaFromData.js +2 -1
  36. package/dist/json-schema/index.d.ts +5 -0
  37. package/dist/json-schema/index.js +5 -0
  38. package/dist/json-schema/jsonSchema.util.d.ts +1 -1
  39. package/dist/json-schema/jsonSchemaBuilder.d.ts +2 -1
  40. package/dist/json-schema/jsonSchemaBuilder.js +2 -1
  41. package/dist/log/index.d.ts +1 -0
  42. package/dist/log/index.js +1 -0
  43. package/dist/math/index.d.ts +4 -0
  44. package/dist/math/index.js +4 -0
  45. package/dist/math/stack.util.js +2 -1
  46. package/dist/object/index.d.ts +6 -0
  47. package/dist/object/index.js +6 -0
  48. package/dist/object/sortObject.d.ts +1 -1
  49. package/dist/promise/index.d.ts +11 -0
  50. package/dist/promise/index.js +11 -0
  51. package/dist/promise/pMap.d.ts +3 -2
  52. package/dist/promise/pMap.js +2 -1
  53. package/dist/promise/pRetry.d.ts +3 -1
  54. package/dist/promise/pRetry.js +4 -1
  55. package/dist/string/index.d.ts +13 -0
  56. package/dist/string/index.js +13 -0
  57. package/dist/typeFest.d.ts +1 -36
  58. package/dist/types.d.ts +6 -1
  59. package/dist/zod/customZod.d.ts +1 -1
  60. package/dist/zod/customZod.js +1 -1
  61. package/dist/zod/zod.shared.schemas.d.ts +1 -1
  62. package/dist/zod/zod.shared.schemas.js +1 -1
  63. package/dist/zod/zod.util.d.ts +1 -1
  64. package/package.json +17 -2
  65. package/src/array/range.ts +1 -2
  66. package/src/bot.model.ts +14 -0
  67. package/src/browser/adminService.ts +1 -1
  68. package/src/{bot.ts → browser/bot.ts} +2 -16
  69. package/src/browser/index.ts +8 -0
  70. package/src/datetime/index.ts +6 -0
  71. package/src/datetime/localTime.ts +1 -1
  72. package/src/decorators/decorator.util.ts +1 -1
  73. package/src/decorators/index.ts +12 -0
  74. package/src/decorators/logMethod.decorator.ts +5 -3
  75. package/src/decorators/retry.decorator.ts +2 -2
  76. package/src/error/assert.ts +1 -2
  77. package/src/error/error.util.ts +5 -5
  78. package/src/error/index.ts +6 -0
  79. package/src/error/try.ts +1 -2
  80. package/src/error/tryCatch.ts +4 -3
  81. package/src/http/fetcher.model.ts +7 -2
  82. package/src/http/fetcher.ts +1 -1
  83. package/src/http/index.ts +3 -0
  84. package/src/index.ts +0 -80
  85. package/src/is.util.ts +1 -2
  86. package/src/iter/asyncIterable2.ts +1 -2
  87. package/src/json-schema/from-data/generateJsonSchemaFromData.ts +3 -4
  88. package/src/json-schema/index.ts +5 -0
  89. package/src/json-schema/jsonSchema.util.ts +1 -1
  90. package/src/json-schema/jsonSchemaBuilder.ts +9 -9
  91. package/src/log/index.ts +1 -0
  92. package/src/math/index.ts +4 -0
  93. package/src/math/stack.util.ts +2 -1
  94. package/src/object/index.ts +6 -0
  95. package/src/object/sortObject.ts +1 -1
  96. package/src/promise/index.ts +11 -0
  97. package/src/promise/pMap.ts +3 -2
  98. package/src/promise/pRetry.ts +6 -2
  99. package/src/string/index.ts +13 -0
  100. package/src/typeFest.ts +1 -38
  101. package/src/types.ts +9 -1
  102. package/src/zod/customZod.ts +1 -1
  103. package/src/zod/zod.shared.schemas.ts +1 -1
  104. package/src/zod/zod.util.ts +1 -1
  105. /package/dist/{time → datetime}/time.util.d.ts +0 -0
  106. /package/dist/{time → datetime}/time.util.js +0 -0
  107. /package/src/{time → datetime}/time.util.ts +0 -0
@@ -1,7 +1,6 @@
1
1
  import { AsyncIterable2 } from '../iter/asyncIterable2.js';
2
2
  import { Iterable2 } from '../iter/iterable2.js';
3
- import type { Primitive } from '../typeFest.js';
4
- import type { Integer } from '../types.js';
3
+ import type { Integer, Primitive } from '../types.js';
5
4
  /**
6
5
  * Returns an array with ranges from `from` up to (but not including) `to`.
7
6
  *
@@ -0,0 +1,12 @@
1
+ export declare enum BotReason {
2
+ NoNavigator = 1,
3
+ NoUserAgent = 2,
4
+ UserAgent = 3,
5
+ WebDriver = 4,
6
+ EmptyLanguages = 6,
7
+ /**
8
+ * This is when CDP is considered to be a reason to be a Bot.
9
+ * By default it's not.
10
+ */
11
+ CDP = 8
12
+ }
@@ -0,0 +1,15 @@
1
+ export var BotReason;
2
+ (function (BotReason) {
3
+ BotReason[BotReason["NoNavigator"] = 1] = "NoNavigator";
4
+ BotReason[BotReason["NoUserAgent"] = 2] = "NoUserAgent";
5
+ BotReason[BotReason["UserAgent"] = 3] = "UserAgent";
6
+ BotReason[BotReason["WebDriver"] = 4] = "WebDriver";
7
+ // ZeroPlugins = 5,
8
+ BotReason[BotReason["EmptyLanguages"] = 6] = "EmptyLanguages";
9
+ // ChromeWithoutChrome = 7,
10
+ /**
11
+ * This is when CDP is considered to be a reason to be a Bot.
12
+ * By default it's not.
13
+ */
14
+ BotReason[BotReason["CDP"] = 8] = "CDP";
15
+ })(BotReason || (BotReason = {}));
@@ -1,4 +1,4 @@
1
- import type { Promisable } from '../typeFest.js';
1
+ import type { Promisable } from '../types.js';
2
2
  export interface AdminModeCfg {
3
3
  /**
4
4
  * Function (predicate) to detect if needed keys are pressed.
@@ -1,3 +1,4 @@
1
+ import { BotReason } from '../bot.model.js';
1
2
  export interface BotDetectionServiceCfg {
2
3
  /**
3
4
  * Defaults to true.
@@ -51,15 +52,3 @@ export declare class BotDetectionService {
51
52
  isCDP(): boolean;
52
53
  private detectCDP;
53
54
  }
54
- export declare enum BotReason {
55
- NoNavigator = 1,
56
- NoUserAgent = 2,
57
- UserAgent = 3,
58
- WebDriver = 4,
59
- EmptyLanguages = 6,
60
- /**
61
- * This is when CDP is considered to be a reason to be a Bot.
62
- * By default it's not.
63
- */
64
- CDP = 8
65
- }
@@ -1,6 +1,7 @@
1
1
  // Relevant material:
2
2
  // https://deviceandbrowserinfo.com/learning_zone/articles/detecting-headless-chrome-puppeteer-2024
3
- import { isServerSide } from './env.js';
3
+ import { BotReason } from '../bot.model.js';
4
+ import { isServerSide } from '../env.js';
4
5
  const botRegex = /bot|spider|crawl|headless|electron|phantom|slimer|proximic|cincraw|slurp|MicrosoftPreview|ahrefs|preview|lighthouse|facebookexternal|pinterest|screaming|apis-google|duplexweb-google|feedfetcher-google|google-read-aloud|googleweblight|mediapartners-google/i;
5
6
  /**
6
7
  * Service to detect bots and CDP (Chrome DevTools Protocol).
@@ -117,18 +118,3 @@ export class BotDetectionService {
117
118
  return cdpCheck1;
118
119
  }
119
120
  }
120
- export var BotReason;
121
- (function (BotReason) {
122
- BotReason[BotReason["NoNavigator"] = 1] = "NoNavigator";
123
- BotReason[BotReason["NoUserAgent"] = 2] = "NoUserAgent";
124
- BotReason[BotReason["UserAgent"] = 3] = "UserAgent";
125
- BotReason[BotReason["WebDriver"] = 4] = "WebDriver";
126
- // ZeroPlugins = 5,
127
- BotReason[BotReason["EmptyLanguages"] = 6] = "EmptyLanguages";
128
- // ChromeWithoutChrome = 7,
129
- /**
130
- * This is when CDP is considered to be a reason to be a Bot.
131
- * By default it's not.
132
- */
133
- BotReason[BotReason["CDP"] = 8] = "CDP";
134
- })(BotReason || (BotReason = {}));
@@ -0,0 +1,8 @@
1
+ export * from './adminService.js';
2
+ export * from './analytics.util.js';
3
+ export * from './bot.js';
4
+ export * from './i18n/fetchTranslationLoader.js';
5
+ export * from './i18n/translation.service.js';
6
+ export * from './imageFitter.js';
7
+ export * from './script.util.js';
8
+ export * from './topbar.js';
@@ -0,0 +1,8 @@
1
+ export * from './adminService.js';
2
+ export * from './analytics.util.js';
3
+ export * from './bot.js';
4
+ export * from './i18n/fetchTranslationLoader.js';
5
+ export * from './i18n/translation.service.js';
6
+ export * from './imageFitter.js';
7
+ export * from './script.util.js';
8
+ export * from './topbar.js';
@@ -0,0 +1,6 @@
1
+ export * from './dateInterval.js';
2
+ export * from './localDate.js';
3
+ export * from './localTime.js';
4
+ export * from './time.util.js';
5
+ export * from './timeInterval.js';
6
+ export * from './wallTime.js';
@@ -0,0 +1,6 @@
1
+ export * from './dateInterval.js';
2
+ export * from './localDate.js';
3
+ export * from './localTime.js';
4
+ export * from './time.util.js';
5
+ export * from './timeInterval.js';
6
+ export * from './wallTime.js';
@@ -1,6 +1,6 @@
1
1
  import { _assert } from '../error/assert.js';
2
- import { _ms } from '../time/time.util.js';
3
2
  import { localDate } from './localDate.js';
3
+ import { _ms } from './time.util.js';
4
4
  import { WallTime } from './wallTime.js';
5
5
  export var ISODayOfWeek;
6
6
  (function (ISODayOfWeek) {
@@ -1,4 +1,4 @@
1
- import type { AnyObject } from '../index.js';
1
+ import type { AnyObject } from '../types.js';
2
2
  /**
3
3
  * @returns
4
4
  * e.g `NameOfYourClass.methodName`
@@ -0,0 +1,12 @@
1
+ export * from './asyncMemo.decorator.js';
2
+ export * from './createPromiseDecorator.js';
3
+ export * from './debounce.decorator.js';
4
+ export * from './debounce.js';
5
+ export * from './decorator.util.js';
6
+ export * from './logMethod.decorator.js';
7
+ export * from './memo.decorator.js';
8
+ export * from './memo.util.js';
9
+ export * from './memoFn.js';
10
+ export * from './memoFnAsync.js';
11
+ export * from './retry.decorator.js';
12
+ export * from './timeout.decorator.js';
@@ -0,0 +1,12 @@
1
+ export * from './asyncMemo.decorator.js';
2
+ export * from './createPromiseDecorator.js';
3
+ export * from './debounce.decorator.js';
4
+ export * from './debounce.js';
5
+ export * from './decorator.util.js';
6
+ export * from './logMethod.decorator.js';
7
+ export * from './memo.decorator.js';
8
+ export * from './memo.util.js';
9
+ export * from './memoFn.js';
10
+ export * from './memoFnAsync.js';
11
+ export * from './retry.decorator.js';
12
+ export * from './timeout.decorator.js';
@@ -1,4 +1,4 @@
1
- import type { CommonLogger } from '../index.js';
1
+ import type { CommonLogger } from '../log/index.js';
2
2
  /**
3
3
  * $r - result
4
4
  *
@@ -1,5 +1,7 @@
1
- import { _assert, _stringify, SimpleMovingAverage } from '../index.js';
2
- import { _ms } from '../time/time.util.js';
1
+ import { _ms } from '../datetime/time.util.js';
2
+ import { _assert } from '../error/index.js';
3
+ import { SimpleMovingAverage } from '../math/index.js';
4
+ import { _stringify } from '../string/index.js';
3
5
  import { _getArgsSignature, _getMethodSignature } from './decorator.util.js';
4
6
  /**
5
7
  * Console-logs when method had started, when it finished, time taken and if error happened.
@@ -1,2 +1,2 @@
1
- import type { PRetryOptions } from '../index.js';
1
+ import type { PRetryOptions } from '../promise/index.js';
2
2
  export declare function _Retry(opt?: PRetryOptions): MethodDecorator;
@@ -1,4 +1,4 @@
1
- import { pRetryFn } from '../index.js';
1
+ import { pRetryFn } from '../promise/index.js';
2
2
  // eslint-disable-next-line @typescript-eslint/naming-convention
3
3
  export function _Retry(opt = {}) {
4
4
  return (_target, _key, descriptor) => {
@@ -1,5 +1,4 @@
1
- import type { Class } from '../typeFest.js';
2
- import type { UnixTimestamp } from '../types.js';
1
+ import type { Class, UnixTimestamp } from '../types.js';
3
2
  import type { BackendErrorResponseObject, ErrorData, ErrorObject } from './error.model.js';
4
3
  /**
5
4
  * Evaluates the `condition` (casts it to Boolean).
@@ -1,4 +1,5 @@
1
- import type { BackendErrorResponseObject, Class, ErrorData, ErrorLike, ErrorObject, HttpRequestErrorData } from '../index.js';
1
+ import type { Class } from '../types.js';
2
+ import type { BackendErrorResponseObject, ErrorData, ErrorLike, ErrorObject, HttpRequestErrorData } from './error.model.js';
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`).
@@ -0,0 +1,6 @@
1
+ export * from './assert.js';
2
+ export * from './error.model.js';
3
+ export * from './error.util.js';
4
+ export * from './errorMode.js';
5
+ export * from './try.js';
6
+ export * from './tryCatch.js';
@@ -0,0 +1,6 @@
1
+ export * from './assert.js';
2
+ export * from './error.model.js';
3
+ export * from './error.util.js';
4
+ export * from './errorMode.js';
5
+ export * from './try.js';
6
+ export * from './tryCatch.js';
@@ -1,5 +1,4 @@
1
- import type { Class } from '../typeFest.js';
2
- import type { AnyFunction, ErrorDataTuple } from '../types.js';
1
+ import type { AnyFunction, Class, ErrorDataTuple } from '../types.js';
3
2
  /**
4
3
  * Calls a function, returns a Tuple of [error, value].
5
4
  * Allows to write shorter code that avoids `try/catch`.
@@ -1,4 +1,4 @@
1
- import type { CommonLogger } from '../index.js';
1
+ import type { CommonLogger } from '../log/index.js';
2
2
  import type { AnyFunction } from '../types.js';
3
3
  export interface TryCatchOptions {
4
4
  /**
@@ -1,4 +1,5 @@
1
- import { _anyToError, _since } from '../index.js';
1
+ import { _since } from '../datetime/index.js';
2
+ import { _anyToError } from './error.util.js';
2
3
  /**
3
4
  * Decorates a function with "try/catch", so it'll never reject/throw.
4
5
  * Only applies to async functions (or, turns sync function into async).
@@ -1,6 +1,7 @@
1
1
  /// <reference lib="es2022" preserve="true" />
2
2
  /// <reference lib="dom" preserve="true" />
3
3
  /// <reference lib="dom.iterable" preserve="true" />
4
+ import { _ms, _since } from '../datetime/time.util.js';
4
5
  import { isServerSide } from '../env.js';
5
6
  import { _assertErrorClassOrRethrow, _assertIsError } from '../error/assert.js';
6
7
  import { _anyToError, _anyToErrorObject, _errorDataAppend, _errorLikeToErrorObject, HttpRequestError, TimeoutError, UnexpectedPassError, } from '../error/error.util.js';
@@ -10,7 +11,6 @@ import { pDelay } from '../promise/pDelay.js';
10
11
  import { pTimeout } from '../promise/pTimeout.js';
11
12
  import { _jsonParse, _jsonParseIfPossible } from '../string/json.util.js';
12
13
  import { _stringify } from '../string/stringify.js';
13
- import { _ms, _since } from '../time/time.util.js';
14
14
  import { HTTP_METHODS } from './http.model.js';
15
15
  const acceptByResponseType = {
16
16
  text: 'text/plain',
@@ -2,8 +2,7 @@
2
2
  /// <reference lib="dom" preserve="true" />
3
3
  import type { ErrorData } from '../error/error.model.js';
4
4
  import type { CommonLogger } from '../log/commonLogger.js';
5
- import type { Promisable } from '../typeFest.js';
6
- import type { AnyObject, NumberOfMilliseconds, Reviver, UnixTimestampMillis } from '../types.js';
5
+ import type { AnyObject, NumberOfMilliseconds, Promisable, Reviver, UnixTimestampMillis } from '../types.js';
7
6
  import type { HttpMethod, HttpStatusFamily } from './http.model.js';
8
7
  export interface FetcherNormalizedCfg extends Required<FetcherCfg>, Omit<FetcherRequest, 'started' | 'fullUrl' | 'logRequest' | 'logRequestBody' | 'logResponse' | 'logResponseBody' | 'debug' | 'redirect' | 'credentials' | 'throwHttpErrors' | 'errorData'> {
9
8
  logger: CommonLogger;
@@ -0,0 +1,3 @@
1
+ export * from './fetcher.js';
2
+ export type * from './fetcher.model.js';
3
+ export * from './http.model.js';
@@ -0,0 +1,2 @@
1
+ export * from './fetcher.js';
2
+ export * from './http.model.js';
package/dist/index.d.ts CHANGED
@@ -1,96 +1,16 @@
1
1
  export * from './abort.js';
2
2
  export * from './array/array.util.js';
3
3
  export * from './array/range.js';
4
- export * from './bot.js';
5
- export * from './browser/adminService.js';
6
- export * from './browser/analytics.util.js';
7
- export * from './browser/i18n/fetchTranslationLoader.js';
8
- export * from './browser/i18n/translation.service.js';
9
- export * from './browser/imageFitter.js';
10
- export * from './browser/script.util.js';
11
- export * from './browser/topbar.js';
12
- export * from './datetime/dateInterval.js';
13
- export * from './datetime/localDate.js';
14
- export * from './datetime/localTime.js';
15
- export * from './datetime/timeInterval.js';
16
- export * from './datetime/wallTime.js';
17
- export * from './decorators/asyncMemo.decorator.js';
18
- export * from './decorators/createPromiseDecorator.js';
19
- export * from './decorators/debounce.decorator.js';
20
- export * from './decorators/debounce.js';
21
- export * from './decorators/decorator.util.js';
22
- export * from './decorators/logMethod.decorator.js';
23
- export * from './decorators/memo.decorator.js';
24
- export * from './decorators/memo.util.js';
25
- export * from './decorators/memoFn.js';
26
- export * from './decorators/memoFnAsync.js';
27
- export * from './decorators/retry.decorator.js';
28
- export * from './decorators/timeout.decorator.js';
29
4
  export * from './define.js';
30
- export * from './deviceIdService.js';
31
5
  export * from './enum.util.js';
32
6
  export * from './env.js';
33
7
  export * from './env/buildInfo.js';
34
- export * from './error/assert.js';
35
- export * from './error/error.model.js';
36
- export * from './error/error.util.js';
37
- export * from './error/errorMode.js';
38
- export * from './error/try.js';
39
- export * from './error/tryCatch.js';
40
8
  export * from './form.util.js';
41
- export * from './http/fetcher.js';
42
- export * from './http/fetcher.model.js';
43
- export * from './http/http.model.js';
44
9
  export * from './is.util.js';
45
10
  export * from './iter/asyncIterable2.js';
46
11
  export * from './iter/iterable2.js';
47
- export * from './json-schema/from-data/generateJsonSchemaFromData.js';
48
- export * from './json-schema/jsonSchema.cnst.js';
49
- export * from './json-schema/jsonSchema.model.js';
50
- export * from './json-schema/jsonSchema.util.js';
51
- export * from './json-schema/jsonSchemaBuilder.js';
52
- export * from './log/commonLogger.js';
53
- export * from './math/accumulatingAverage.js';
54
- export * from './math/math.util.js';
55
- export * from './math/sma.js';
56
- export * from './math/stack.util.js';
57
- export * from './nanoid.js';
58
12
  export * from './number/createDeterministicRandom.js';
59
13
  export * from './number/number.util.js';
60
- export * from './object/deepEquals.js';
61
- export * from './object/map2.js';
62
- export * from './object/object.util.js';
63
- export * from './object/set2.js';
64
- export * from './object/sortObject.js';
65
- export * from './object/sortObjectDeep.js';
66
14
  export * from './polyfill.js';
67
- export * from './promise/abortable.js';
68
- export * from './promise/pDefer.js';
69
- export * from './promise/pDelay.js';
70
- export * from './promise/pFilter.js';
71
- export * from './promise/pHang.js';
72
- export * from './promise/pMap.js';
73
- export * from './promise/pProps.js';
74
- export * from './promise/pQueue.js';
75
- export * from './promise/pRetry.js';
76
- export * from './promise/pState.js';
77
- export * from './promise/pTimeout.js';
78
- export * from './semver.js';
79
- export * from './string/case.js';
80
- export * from './string/escape.js';
81
- export * from './string/hash.util.js';
82
- export * from './string/json.util.js';
83
- export * from './string/leven.js';
84
- export * from './string/pupa.js';
85
- export * from './string/readingTime.js';
86
- export * from './string/regex.js';
87
- export * from './string/safeJsonStringify.js';
88
- export * from './string/slugify.js';
89
- export * from './string/string.util.js';
90
- export * from './string/stringify.js';
91
- export * from './string/url.util.js';
92
- export * from './time/time.util.js';
93
- export * from './typeFest.js';
94
- export * from './types.js';
95
15
  export * from './unit/size.util.js';
96
16
  export * from './web.js';
package/dist/index.js CHANGED
@@ -1,96 +1,16 @@
1
1
  export * from './abort.js';
2
2
  export * from './array/array.util.js';
3
3
  export * from './array/range.js';
4
- export * from './bot.js';
5
- export * from './browser/adminService.js';
6
- export * from './browser/analytics.util.js';
7
- export * from './browser/i18n/fetchTranslationLoader.js';
8
- export * from './browser/i18n/translation.service.js';
9
- export * from './browser/imageFitter.js';
10
- export * from './browser/script.util.js';
11
- export * from './browser/topbar.js';
12
- export * from './datetime/dateInterval.js';
13
- export * from './datetime/localDate.js';
14
- export * from './datetime/localTime.js';
15
- export * from './datetime/timeInterval.js';
16
- export * from './datetime/wallTime.js';
17
- export * from './decorators/asyncMemo.decorator.js';
18
- export * from './decorators/createPromiseDecorator.js';
19
- export * from './decorators/debounce.decorator.js';
20
- export * from './decorators/debounce.js';
21
- export * from './decorators/decorator.util.js';
22
- export * from './decorators/logMethod.decorator.js';
23
- export * from './decorators/memo.decorator.js';
24
- export * from './decorators/memo.util.js';
25
- export * from './decorators/memoFn.js';
26
- export * from './decorators/memoFnAsync.js';
27
- export * from './decorators/retry.decorator.js';
28
- export * from './decorators/timeout.decorator.js';
29
4
  export * from './define.js';
30
- export * from './deviceIdService.js';
31
5
  export * from './enum.util.js';
32
6
  export * from './env.js';
33
7
  export * from './env/buildInfo.js';
34
- export * from './error/assert.js';
35
- export * from './error/error.model.js';
36
- export * from './error/error.util.js';
37
- export * from './error/errorMode.js';
38
- export * from './error/try.js';
39
- export * from './error/tryCatch.js';
40
8
  export * from './form.util.js';
41
- export * from './http/fetcher.js';
42
- export * from './http/fetcher.model.js';
43
- export * from './http/http.model.js';
44
9
  export * from './is.util.js';
45
10
  export * from './iter/asyncIterable2.js';
46
11
  export * from './iter/iterable2.js';
47
- export * from './json-schema/from-data/generateJsonSchemaFromData.js';
48
- export * from './json-schema/jsonSchema.cnst.js';
49
- export * from './json-schema/jsonSchema.model.js';
50
- export * from './json-schema/jsonSchema.util.js';
51
- export * from './json-schema/jsonSchemaBuilder.js';
52
- export * from './log/commonLogger.js';
53
- export * from './math/accumulatingAverage.js';
54
- export * from './math/math.util.js';
55
- export * from './math/sma.js';
56
- export * from './math/stack.util.js';
57
- export * from './nanoid.js';
58
12
  export * from './number/createDeterministicRandom.js';
59
13
  export * from './number/number.util.js';
60
- export * from './object/deepEquals.js';
61
- export * from './object/map2.js';
62
- export * from './object/object.util.js';
63
- export * from './object/set2.js';
64
- export * from './object/sortObject.js';
65
- export * from './object/sortObjectDeep.js';
66
14
  export * from './polyfill.js';
67
- export * from './promise/abortable.js';
68
- export * from './promise/pDefer.js';
69
- export * from './promise/pDelay.js';
70
- export * from './promise/pFilter.js';
71
- export * from './promise/pHang.js';
72
- export * from './promise/pMap.js';
73
- export * from './promise/pProps.js';
74
- export * from './promise/pQueue.js';
75
- export * from './promise/pRetry.js';
76
- export * from './promise/pState.js';
77
- export * from './promise/pTimeout.js';
78
- export * from './semver.js';
79
- export * from './string/case.js';
80
- export * from './string/escape.js';
81
- export * from './string/hash.util.js';
82
- export * from './string/json.util.js';
83
- export * from './string/leven.js';
84
- export * from './string/pupa.js';
85
- export * from './string/readingTime.js';
86
- export * from './string/regex.js';
87
- export * from './string/safeJsonStringify.js';
88
- export * from './string/slugify.js';
89
- export * from './string/string.util.js';
90
- export * from './string/stringify.js';
91
- export * from './string/url.util.js';
92
- export * from './time/time.util.js';
93
- export * from './typeFest.js';
94
- export * from './types.js';
95
15
  export * from './unit/size.util.js';
96
16
  export * from './web.js';
package/dist/is.util.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import type { Primitive } from './typeFest.js';
2
- import type { AnyObject, FalsyValue, NullishValue } from './types.js';
1
+ import type { AnyObject, FalsyValue, NullishValue, Primitive } from './types.js';
3
2
  type Nullish<T> = T extends NullishValue ? T : never;
4
3
  type Truthy<T> = T extends FalsyValue ? never : T;
5
4
  type Falsy<T> = T extends FalsyValue ? T : never;
@@ -1,5 +1,4 @@
1
- import type { Promisable } from '../typeFest.js';
2
- import type { AbortableAsyncMapper, AbortableAsyncPredicate } from '../types.js';
1
+ import type { AbortableAsyncMapper, AbortableAsyncPredicate, Promisable } from '../types.js';
3
2
  import { END } from '../types.js';
4
3
  /**
5
4
  * Similar to Iterable2, but for AsyncIterable.
@@ -1,4 +1,5 @@
1
- import type { AnyObject, JsonSchemaObject } from '../../index.js';
1
+ import { type AnyObject } from '../../types.js';
2
+ import type { JsonSchemaObject } from '../index.js';
2
3
  /**
3
4
  * Each row must be an object (current limitation).
4
5
  *
@@ -1,4 +1,5 @@
1
- import { _stringMapEntries, _uniq } from '../../index.js';
1
+ import { _uniq } from '../../index.js';
2
+ import { _stringMapEntries } from '../../types.js';
2
3
  /**
3
4
  * Each row must be an object (current limitation).
4
5
  *
@@ -0,0 +1,5 @@
1
+ export * from './from-data/generateJsonSchemaFromData.js';
2
+ export * from './jsonSchema.cnst.js';
3
+ export * from './jsonSchema.model.js';
4
+ export * from './jsonSchema.util.js';
5
+ export * from './jsonSchemaBuilder.js';
@@ -0,0 +1,5 @@
1
+ export * from './from-data/generateJsonSchemaFromData.js';
2
+ export * from './jsonSchema.cnst.js';
3
+ export * from './jsonSchema.model.js';
4
+ export * from './jsonSchema.util.js';
5
+ export * from './jsonSchemaBuilder.js';
@@ -1,4 +1,4 @@
1
- import type { AnyObject } from '../index.js';
1
+ import type { AnyObject } from '../types.js';
2
2
  import type { JsonSchemaObject } from './jsonSchema.model.js';
3
3
  /**
4
4
  * Merges s2 into s1 (mutates s1) and returns s1.
@@ -1,4 +1,5 @@
1
- import type { AnyObject, BaseDBEntity, JsonSchemaAllOf, JsonSchemaArray, JsonSchemaOneOf, JsonSchemaTuple } from '../index.js';
1
+ import type { AnyObject, BaseDBEntity } from '../types.js';
2
+ import { type JsonSchemaAllOf, type JsonSchemaArray, type JsonSchemaOneOf, type JsonSchemaTuple } from './index.js';
2
3
  import type { JsonSchema, JsonSchemaAny, JsonSchemaBoolean, JsonSchemaConst, JsonSchemaEnum, JsonSchemaNull, JsonSchemaNumber, JsonSchemaObject, JsonSchemaRef, JsonSchemaString } from './jsonSchema.model.js';
3
4
  export interface JsonSchemaBuilder<T = unknown> {
4
5
  build: () => JsonSchema<T>;
@@ -1,5 +1,6 @@
1
1
  import { _uniq } from '../array/array.util.js';
2
- import { _deepCopy, _sortObject, mergeJsonSchemaObjects } from '../index.js';
2
+ import { _deepCopy, _sortObject } from '../object/index.js';
3
+ import { mergeJsonSchemaObjects, } from './index.js';
3
4
  import { JSON_SCHEMA_ORDER } from './jsonSchema.cnst.js';
4
5
  /**
5
6
  * Fluent (chainable) API to manually create Json Schemas.
@@ -0,0 +1 @@
1
+ export * from './commonLogger.js';
@@ -0,0 +1 @@
1
+ export * from './commonLogger.js';
@@ -0,0 +1,4 @@
1
+ export * from './accumulatingAverage.js';
2
+ export * from './math.util.js';
3
+ export * from './sma.js';
4
+ export * from './stack.util.js';
@@ -0,0 +1,4 @@
1
+ export * from './accumulatingAverage.js';
2
+ export * from './math.util.js';
3
+ export * from './sma.js';
4
+ export * from './stack.util.js';
@@ -1,4 +1,5 @@
1
- import { _average, _percentile, _percentiles, _range } from '../index.js';
1
+ import { _range } from '../array/range.js';
2
+ import { _average, _percentile, _percentiles } from '../math/index.js';
2
3
  /**
3
4
  * Implements a "round-robin" Stack ("first-in last-out" aka FILO) with a limited size.
4
5
  * Like an array of a fixed size. When it runs out of space - it starts writing on top of itself
@@ -0,0 +1,6 @@
1
+ export * from './deepEquals.js';
2
+ export * from './map2.js';
3
+ export * from './object.util.js';
4
+ export * from './set2.js';
5
+ export * from './sortObject.js';
6
+ export * from './sortObjectDeep.js';
@@ -0,0 +1,6 @@
1
+ export * from './deepEquals.js';
2
+ export * from './map2.js';
3
+ export * from './object.util.js';
4
+ export * from './set2.js';
5
+ export * from './sortObject.js';
6
+ export * from './sortObjectDeep.js';
@@ -1,4 +1,4 @@
1
- import type { AnyObject } from '../index.js';
1
+ import type { AnyObject } from '../types.js';
2
2
  /**
3
3
  * Returns new object with keys sorder in the given order.
4
4
  * All keys that are not listed in `keyOrder` go last.
@@ -0,0 +1,11 @@
1
+ export * from './abortable.js';
2
+ export * from './pDefer.js';
3
+ export * from './pDelay.js';
4
+ export * from './pFilter.js';
5
+ export * from './pHang.js';
6
+ export * from './pMap.js';
7
+ export * from './pProps.js';
8
+ export * from './pQueue.js';
9
+ export * from './pRetry.js';
10
+ export * from './pState.js';
11
+ export * from './pTimeout.js';