@naturalcycles/nodejs-lib 12.85.1 → 12.85.3

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.
@@ -7,5 +7,7 @@ import { GetGotOptions } from './got.model';
7
7
  * 2. Hooks that log start/end of request (optional, false by default).
8
8
  * 3. Reasonable defaults(tm), e.g non-infinite Timeout
9
9
  * 4. Preserves error stack traces (!) (experimental!)
10
+ *
11
+ * @deprecated `getGot` (together with `getKy`) is deprecated in favor of `getFetcher` of js-lib
10
12
  */
11
13
  export declare function getGot(opt?: GetGotOptions): Got;
@@ -12,6 +12,8 @@ const __1 = require("..");
12
12
  * 2. Hooks that log start/end of request (optional, false by default).
13
13
  * 3. Reasonable defaults(tm), e.g non-infinite Timeout
14
14
  * 4. Preserves error stack traces (!) (experimental!)
15
+ *
16
+ * @deprecated `getGot` (together with `getKy`) is deprecated in favor of `getFetcher` of js-lib
15
17
  */
16
18
  function getGot(opt = {}) {
17
19
  opt.logger ||= console;
@@ -33,7 +33,7 @@ function transformMap(mapper, opt = {}) {
33
33
  logErrorStats(true);
34
34
  if (collectedErrors.length) {
35
35
  // emit Aggregated error
36
- cb(new js_lib_1.AggregatedError(collectedErrors));
36
+ cb(new AggregateError(collectedErrors, `transformMap resulted in ${collectedErrors.length} error(s)`));
37
37
  }
38
38
  else {
39
39
  // emit no error
@@ -70,7 +70,7 @@ function transformMapSync(mapper, opt = {}) {
70
70
  logErrorStats(true);
71
71
  if (collectedErrors.length) {
72
72
  // emit Aggregated error
73
- cb(new js_lib_1.AggregatedError(collectedErrors));
73
+ cb(new AggregateError(collectedErrors, `transformMapSync resulted in ${collectedErrors.length} error(s)`));
74
74
  }
75
75
  else {
76
76
  // emit no error
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/nodejs-lib",
3
- "version": "12.85.1",
3
+ "version": "12.85.3",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "docs-serve": "vuepress dev docs",
package/src/got/getGot.ts CHANGED
@@ -17,6 +17,8 @@ import { GetGotOptions, GotRequestContext } from './got.model'
17
17
  * 2. Hooks that log start/end of request (optional, false by default).
18
18
  * 3. Reasonable defaults(tm), e.g non-infinite Timeout
19
19
  * 4. Preserves error stack traces (!) (experimental!)
20
+ *
21
+ * @deprecated `getGot` (together with `getKy`) is deprecated in favor of `getFetcher` of js-lib
20
22
  */
21
23
  export function getGot(opt: GetGotOptions = {}): Got {
22
24
  opt.logger ||= console
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  _anyToError,
3
3
  AbortableAsyncMapper,
4
- AggregatedError,
5
4
  AsyncPredicate,
6
5
  CommonLogger,
7
6
  END,
@@ -104,7 +103,12 @@ export function transformMap<IN = any, OUT = IN>(
104
103
 
105
104
  if (collectedErrors.length) {
106
105
  // emit Aggregated error
107
- cb(new AggregatedError(collectedErrors))
106
+ cb(
107
+ new AggregateError(
108
+ collectedErrors,
109
+ `transformMap resulted in ${collectedErrors.length} error(s)`,
110
+ ),
111
+ )
108
112
  } else {
109
113
  // emit no error
110
114
  cb()
@@ -1,6 +1,5 @@
1
1
  import {
2
2
  _anyToError,
3
- AggregatedError,
4
3
  CommonLogger,
5
4
  END,
6
5
  ErrorMode,
@@ -141,7 +140,12 @@ export function transformMapSync<IN = any, OUT = IN>(
141
140
 
142
141
  if (collectedErrors.length) {
143
142
  // emit Aggregated error
144
- cb(new AggregatedError(collectedErrors))
143
+ cb(
144
+ new AggregateError(
145
+ collectedErrors,
146
+ `transformMapSync resulted in ${collectedErrors.length} error(s)`,
147
+ ),
148
+ )
145
149
  } else {
146
150
  // emit no error
147
151
  cb()