@daiso-tech/core 0.35.1 → 0.35.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.
- package/dist/async/middlewares/_shared.d.ts +1 -1
- package/dist/async/middlewares/bulkhead/bulkhead.middleware.d.ts +5 -5
- package/dist/async/middlewares/bulkhead/bulkhead.middleware.js +1 -1
- package/dist/async/middlewares/dynamic/dynamic.middleware.d.ts +1 -1
- package/dist/async/middlewares/dynamic/dynamic.middleware.js +1 -1
- package/dist/async/middlewares/fallback/fallback.middleware.d.ts +5 -5
- package/dist/async/middlewares/fallback/fallback.middleware.js +1 -1
- package/dist/async/middlewares/hedging/concurrent-hedging/concurrent-hedging.middleware.d.ts +1 -1
- package/dist/async/middlewares/hedging/concurrent-hedging/concurrent-hedging.middleware.js +1 -1
- package/dist/async/middlewares/hedging/sequential-hedging/sequential-hedging.middleware.d.ts +1 -1
- package/dist/async/middlewares/hedging/sequential-hedging/sequential-hedging.middleware.js +1 -1
- package/dist/async/middlewares/observe/observe.middleware.d.ts +10 -10
- package/dist/async/middlewares/observe/observe.middleware.js +1 -1
- package/dist/async/middlewares/timeout/timeout.middleware.d.ts +5 -5
- package/dist/async/middlewares/timeout/timeout.middleware.js +1 -1
- package/dist/utilities/classes/hooks/async-hooks.d.ts +2 -0
- package/dist/utilities/classes/hooks/async-hooks.js +2 -0
- package/dist/utilities/classes/hooks/async-hooks.js.map +1 -1
- package/dist/utilities/classes/hooks/hooks.d.ts +2 -0
- package/dist/utilities/classes/hooks/hooks.js +2 -0
- package/dist/utilities/classes/hooks/hooks.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import { TimeSpan, type AsyncMiddlewareFn, type HookContext, type Invokable } fr
|
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
7
7
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
8
|
-
* @group
|
|
8
|
+
* @group Middlewares
|
|
9
9
|
*/
|
|
10
10
|
export type OnProcessingData<TParameters extends unknown[] = unknown[], TContext extends HookContext = HookContext> = {
|
|
11
11
|
args: TParameters;
|
|
@@ -14,13 +14,13 @@ export type OnProcessingData<TParameters extends unknown[] = unknown[], TContext
|
|
|
14
14
|
/**
|
|
15
15
|
*
|
|
16
16
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
17
|
-
* @group
|
|
17
|
+
* @group Middlewares
|
|
18
18
|
*/
|
|
19
19
|
export type OnProcessing<TParameters extends unknown[] = unknown[], TContext extends HookContext = HookContext> = Invokable<[data: OnProcessingData<TParameters, TContext>]>;
|
|
20
20
|
/**
|
|
21
21
|
*
|
|
22
22
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
23
|
-
* @group
|
|
23
|
+
* @group Middlewares
|
|
24
24
|
*/
|
|
25
25
|
export type BulkheadCallbacks<TParameters extends unknown[] = unknown[], TContext extends HookContext = HookContext> = {
|
|
26
26
|
onProcessing?: OnProcessing<TParameters, TContext>;
|
|
@@ -28,7 +28,7 @@ export type BulkheadCallbacks<TParameters extends unknown[] = unknown[], TContex
|
|
|
28
28
|
/**
|
|
29
29
|
*
|
|
30
30
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
31
|
-
* @group
|
|
31
|
+
* @group Middlewares
|
|
32
32
|
*/
|
|
33
33
|
export type BulkheadSettings<TParameters extends unknown[] = unknown[], TContext extends HookContext = HookContext> = BulkheadCallbacks<TParameters, TContext> & {
|
|
34
34
|
/**
|
|
@@ -59,7 +59,7 @@ export type BulkheadSettings<TParameters extends unknown[] = unknown[], TContext
|
|
|
59
59
|
* You can provide {@link BulkheadSettings | `settings.maxCapacity`}
|
|
60
60
|
*
|
|
61
61
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
62
|
-
* @group
|
|
62
|
+
* @group Middlewares
|
|
63
63
|
* @throws {CapacityFullAsyncError} {@link CapacityFullAsyncError}
|
|
64
64
|
* ```ts
|
|
65
65
|
* import { bulkhead } from "@daiso-tech/core/async";
|
|
@@ -8,7 +8,7 @@ import { PromiseQueue } from "../../../async/utilities/_module.js";
|
|
|
8
8
|
* You can provide {@link BulkheadSettings | `settings.maxCapacity`}
|
|
9
9
|
*
|
|
10
10
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
11
|
-
* @group
|
|
11
|
+
* @group Middlewares
|
|
12
12
|
* @throws {CapacityFullAsyncError} {@link CapacityFullAsyncError}
|
|
13
13
|
* ```ts
|
|
14
14
|
* import { bulkhead } from "@daiso-tech/core/async";
|
|
@@ -7,7 +7,7 @@ import { type AsyncMiddlewareFn, type Invokable } from "../../../utilities/_modu
|
|
|
7
7
|
* The `dynamic` is wrapper middleware that allows configuration of other middlewares dynamically based on the function arguments and context.
|
|
8
8
|
*
|
|
9
9
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
10
|
-
* @group
|
|
10
|
+
* @group Middlewares
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
@@ -6,7 +6,7 @@ import { callInvokable, } from "../../../utilities/_module-exports.js";
|
|
|
6
6
|
* The `dynamic` is wrapper middleware that allows configuration of other middlewares dynamically based on the function arguments and context.
|
|
7
7
|
*
|
|
8
8
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
9
|
-
* @group
|
|
9
|
+
* @group Middlewares
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
@@ -7,7 +7,7 @@ import type { ErrorPolicy } from "../../../async/middlewares/_shared.js";
|
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
9
9
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
10
|
-
* @group
|
|
10
|
+
* @group Middlewares
|
|
11
11
|
*/
|
|
12
12
|
export type OnFallbackData<TParameters extends unknown[] = unknown[], TFallbackValue = unknown, TContext extends HookContext = HookContext> = {
|
|
13
13
|
error: unknown;
|
|
@@ -18,13 +18,13 @@ export type OnFallbackData<TParameters extends unknown[] = unknown[], TFallbackV
|
|
|
18
18
|
/**
|
|
19
19
|
*
|
|
20
20
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
21
|
-
* @group
|
|
21
|
+
* @group Middlewares
|
|
22
22
|
*/
|
|
23
23
|
export type OnFallback<TParameters extends unknown[] = unknown[], TFallbackValue = unknown, TContext extends HookContext = HookContext> = Invokable<[data: OnFallbackData<TParameters, TFallbackValue, TContext>]>;
|
|
24
24
|
/**
|
|
25
25
|
*
|
|
26
26
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
27
|
-
* @group
|
|
27
|
+
* @group Middlewares
|
|
28
28
|
*/
|
|
29
29
|
export type FallbackCallbacks<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> = {
|
|
30
30
|
/**
|
|
@@ -35,7 +35,7 @@ export type FallbackCallbacks<TParameters extends unknown[] = unknown[], TReturn
|
|
|
35
35
|
/**
|
|
36
36
|
*
|
|
37
37
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
38
|
-
* @group
|
|
38
|
+
* @group Middlewares
|
|
39
39
|
*/
|
|
40
40
|
export type FallbackSettings<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> = FallbackCallbacks<TParameters, TReturn, TContext> & {
|
|
41
41
|
fallbackValue: AsyncLazyable<TReturn>;
|
|
@@ -53,7 +53,7 @@ export type FallbackSettings<TParameters extends unknown[] = unknown[], TReturn
|
|
|
53
53
|
* The `fallback` middleware adds fallback value when an error occurs.
|
|
54
54
|
*
|
|
55
55
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
56
|
-
* @group
|
|
56
|
+
* @group Middlewares
|
|
57
57
|
*
|
|
58
58
|
* @example
|
|
59
59
|
* ```ts
|
|
@@ -6,7 +6,7 @@ import { callInvokable, resolveAsyncLazyable, } from "../../../utilities/_module
|
|
|
6
6
|
* The `fallback` middleware adds fallback value when an error occurs.
|
|
7
7
|
*
|
|
8
8
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
9
|
-
* @group
|
|
9
|
+
* @group Middlewares
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
package/dist/async/middlewares/hedging/concurrent-hedging/concurrent-hedging.middleware.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { HedgingSettings } from "../../../../async/middlewares/hedging/_sha
|
|
|
9
9
|
* If all function fail than error is thrown.
|
|
10
10
|
*
|
|
11
11
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
12
|
-
* @group
|
|
12
|
+
* @group Middlewares
|
|
13
13
|
* @throws {HedgingAsyncError} {@link HedgingAsyncError}
|
|
14
14
|
*
|
|
15
15
|
* @example
|
package/dist/async/middlewares/hedging/sequential-hedging/sequential-hedging.middleware.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { HedgingSettings } from "../../../../async/middlewares/hedging/_sha
|
|
|
9
9
|
* If all function fail than error is thrown.
|
|
10
10
|
*
|
|
11
11
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
12
|
-
* @group
|
|
12
|
+
* @group Middlewares
|
|
13
13
|
* @throws {HedgingAsyncError} {@link HedgingAsyncError}
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
@@ -10,7 +10,7 @@ import { timeoutAndFail } from "../../../../async/utilities/_module.js";
|
|
|
10
10
|
* If all function fail than error is thrown.
|
|
11
11
|
*
|
|
12
12
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
13
|
-
* @group
|
|
13
|
+
* @group Middlewares
|
|
14
14
|
* @throws {HedgingAsyncError} {@link HedgingAsyncError}
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
@@ -6,7 +6,7 @@ import { type AsyncMiddlewareFn, type Invokable } from "../../../utilities/_modu
|
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
9
|
-
* @group
|
|
9
|
+
* @group Middlewares
|
|
10
10
|
*/
|
|
11
11
|
export type OnObserveStartData<TParameters extends unknown[] = unknown[], TContext extends HookContext = HookContext> = {
|
|
12
12
|
args: TParameters;
|
|
@@ -15,13 +15,13 @@ export type OnObserveStartData<TParameters extends unknown[] = unknown[], TConte
|
|
|
15
15
|
/**
|
|
16
16
|
*
|
|
17
17
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
18
|
-
* @group
|
|
18
|
+
* @group Middlewares
|
|
19
19
|
*/
|
|
20
20
|
export type OnObserveStart<TParameters extends unknown[] = unknown[], TContext extends HookContext = HookContext> = Invokable<[data: OnObserveStartData<TParameters, TContext>]>;
|
|
21
21
|
/**
|
|
22
22
|
*
|
|
23
23
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
24
|
-
* @group
|
|
24
|
+
* @group Middlewares
|
|
25
25
|
*/
|
|
26
26
|
export type OnObserveSuccessData<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> = {
|
|
27
27
|
returnValue: TReturn;
|
|
@@ -31,13 +31,13 @@ export type OnObserveSuccessData<TParameters extends unknown[] = unknown[], TRet
|
|
|
31
31
|
/**
|
|
32
32
|
*
|
|
33
33
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
34
|
-
* @group
|
|
34
|
+
* @group Middlewares
|
|
35
35
|
*/
|
|
36
36
|
export type OnObserveSuccess<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> = Invokable<[data: OnObserveSuccessData<TParameters, TReturn, TContext>]>;
|
|
37
37
|
/**
|
|
38
38
|
*
|
|
39
39
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
40
|
-
* @group
|
|
40
|
+
* @group Middlewares
|
|
41
41
|
*/
|
|
42
42
|
export type OnObserveErrorData<TParameters extends unknown[] = unknown[], TContext extends HookContext = HookContext> = {
|
|
43
43
|
error: unknown;
|
|
@@ -47,7 +47,7 @@ export type OnObserveErrorData<TParameters extends unknown[] = unknown[], TConte
|
|
|
47
47
|
/**
|
|
48
48
|
*
|
|
49
49
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
50
|
-
* @group
|
|
50
|
+
* @group Middlewares
|
|
51
51
|
*/
|
|
52
52
|
export type OnObserveFinallyData<TContext extends HookContext = HookContext> = {
|
|
53
53
|
executionTime: TimeSpan;
|
|
@@ -56,19 +56,19 @@ export type OnObserveFinallyData<TContext extends HookContext = HookContext> = {
|
|
|
56
56
|
/**
|
|
57
57
|
*
|
|
58
58
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
59
|
-
* @group
|
|
59
|
+
* @group Middlewares
|
|
60
60
|
*/
|
|
61
61
|
export type OnObserveError<TParameters extends unknown[] = unknown[], TContext extends HookContext = HookContext> = Invokable<[data: OnObserveErrorData<TParameters, TContext>]>;
|
|
62
62
|
/**
|
|
63
63
|
*
|
|
64
64
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
65
|
-
* @group
|
|
65
|
+
* @group Middlewares
|
|
66
66
|
*/
|
|
67
67
|
export type OnObserveFinally<TContext extends HookContext = HookContext> = Invokable<[data: OnObserveFinallyData<TContext>]>;
|
|
68
68
|
/**
|
|
69
69
|
*
|
|
70
70
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
71
|
-
* @group
|
|
71
|
+
* @group Middlewares
|
|
72
72
|
*/
|
|
73
73
|
export type ObserveCallbacks<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> = {
|
|
74
74
|
/**
|
|
@@ -92,7 +92,7 @@ export type ObserveCallbacks<TParameters extends unknown[] = unknown[], TReturn
|
|
|
92
92
|
* The `observe` middleware tracks an async function's state and runs callbacks when it fails with an error or succeeds.
|
|
93
93
|
*
|
|
94
94
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
95
|
-
* @group
|
|
95
|
+
* @group Middlewares
|
|
96
96
|
*
|
|
97
97
|
* @example
|
|
98
98
|
* ```ts
|
|
@@ -7,7 +7,7 @@ import { callInvokable, } from "../../../utilities/_module-exports.js";
|
|
|
7
7
|
* The `observe` middleware tracks an async function's state and runs callbacks when it fails with an error or succeeds.
|
|
8
8
|
*
|
|
9
9
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
10
|
-
* @group
|
|
10
|
+
* @group Middlewares
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
@@ -7,7 +7,7 @@ import { type Invokable } from "../../../utilities/_module-exports.js";
|
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
9
9
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
10
|
-
* @group
|
|
10
|
+
* @group Middlewares
|
|
11
11
|
*/
|
|
12
12
|
export type OnTimeoutData<TParameters extends unknown[] = unknown[], TContext extends HookContext = HookContext> = {
|
|
13
13
|
waitTime: TimeSpan;
|
|
@@ -17,13 +17,13 @@ export type OnTimeoutData<TParameters extends unknown[] = unknown[], TContext ex
|
|
|
17
17
|
/**
|
|
18
18
|
*
|
|
19
19
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
20
|
-
* @group
|
|
20
|
+
* @group Middlewares
|
|
21
21
|
*/
|
|
22
22
|
export type OnTimeout<TParameters extends unknown[] = unknown[], TContext extends HookContext = HookContext> = Invokable<[data: OnTimeoutData<TParameters, TContext>]>;
|
|
23
23
|
/**
|
|
24
24
|
*
|
|
25
25
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
26
|
-
* @group
|
|
26
|
+
* @group Middlewares
|
|
27
27
|
*/
|
|
28
28
|
export type TimeoutCallbacks<TParameters extends unknown[] = unknown[], TContext extends HookContext = HookContext> = {
|
|
29
29
|
/**
|
|
@@ -34,7 +34,7 @@ export type TimeoutCallbacks<TParameters extends unknown[] = unknown[], TContext
|
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
36
36
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
37
|
-
* @group
|
|
37
|
+
* @group Middlewares
|
|
38
38
|
*/
|
|
39
39
|
export type TimeoutSettings<TParameters extends unknown[] = unknown[], TContext extends HookContext = HookContext> = TimeoutCallbacks<TParameters, TContext> & {
|
|
40
40
|
/**
|
|
@@ -54,7 +54,7 @@ export type TimeoutSettings<TParameters extends unknown[] = unknown[], TContext
|
|
|
54
54
|
* Note the original function continues executing (even if the promise fails), you'll need to provide a settings.signalBinder to forward the `AbortSignal`.
|
|
55
55
|
*
|
|
56
56
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
57
|
-
* @group
|
|
57
|
+
* @group Middlewares
|
|
58
58
|
* @throws {TimeoutAsyncError} {@link TimeoutAsyncError}
|
|
59
59
|
*
|
|
60
60
|
* @example
|
|
@@ -11,7 +11,7 @@ import { timeoutAndFail } from "../../../async/utilities/_module.js";
|
|
|
11
11
|
* Note the original function continues executing (even if the promise fails), you'll need to provide a settings.signalBinder to forward the `AbortSignal`.
|
|
12
12
|
*
|
|
13
13
|
* IMPORT_PATH: `"@daiso-tech/core/async"`
|
|
14
|
-
* @group
|
|
14
|
+
* @group Middlewares
|
|
15
15
|
* @throws {TimeoutAsyncError} {@link TimeoutAsyncError}
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
@@ -132,6 +132,8 @@ export type AsyncHooksSettings<TParameters extends unknown[] = unknown[], TConte
|
|
|
132
132
|
* The `AsyncHooks` class provides a convenient way to change and inspect arguments and return value of both async and sync functions.
|
|
133
133
|
* For example `AsyncHooks` class can be used to log function arguments and return values. Note this class will always return promise and is immutable.
|
|
134
134
|
*
|
|
135
|
+
* Middlewares apply left to right: each wraps the next, with the leftmost being the outermost layer and the rightmost wrapping the original function.
|
|
136
|
+
*
|
|
135
137
|
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
136
138
|
* @group Hooks
|
|
137
139
|
*/
|
|
@@ -6,6 +6,8 @@ import { callInvokable, getInvokableName, resolveInvokable, resolveOneOrMore, }
|
|
|
6
6
|
* The `AsyncHooks` class provides a convenient way to change and inspect arguments and return value of both async and sync functions.
|
|
7
7
|
* For example `AsyncHooks` class can be used to log function arguments and return values. Note this class will always return promise and is immutable.
|
|
8
8
|
*
|
|
9
|
+
* Middlewares apply left to right: each wraps the next, with the leftmost being the outermost layer and the rightmost wrapping the original function.
|
|
10
|
+
*
|
|
9
11
|
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
10
12
|
* @group Hooks
|
|
11
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-hooks.js","sourceRoot":"","sources":["../../../../src/utilities/classes/hooks/async-hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAMnB,MAAM,gCAAgC,CAAC;AAsKxC
|
|
1
|
+
{"version":3,"file":"async-hooks.js","sourceRoot":"","sources":["../../../../src/utilities/classes/hooks/async-hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAMnB,MAAM,gCAAgC,CAAC;AAsKxC;;;;;;;;GAQG;AACH,MAAM,OAAO,UAAU;IA6HE;IACA;IAGA;IA3Hb,MAAM,CAAC,wBAAwB;QAGnC,OAAO;YACH,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;YAC7B,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,eAAe,EAAE,CAAC,MAAM;SAChD,CAAC;IACN,CAAC;IAEO,MAAM,CAAC,mBAAmB,CAC9B,YAA4C,EAC5C,IAAiB;QAEjB,MAAM,WAAW,GACb,aAAa,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC;YAC3C,IAAI,eAAe,EAAE,CAAC,MAAM,CAAC;QACjC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,CAAC,MAAe,EAAQ,EAAE;YACpC,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;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IAChB,CAAC;IAEgB,IAAI,CAAgD;IAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6CG;IACH,YACqB,SAAsD,EACtD,WAEhB,EACgB,WAGb,EAAE;QAPW,cAAS,GAAT,SAAS,CAA6C;QACtD,gBAAW,GAAX,WAAW,CAE3B;QACgB,aAAQ,GAAR,QAAQ,CAGnB;QAEN,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvE,CAAC;IAED;;OAEG;IACH,IAAI,CACA,WAAuE;QAEvE,OAAO,IAAI,UAAU,CACjB,IAAI,CAAC,SAAS,EACd;YACI,GAAG,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC;YACrC,GAAG,gBAAgB,CAAC,WAAW,CAAC;SACnC,EACD,IAAI,CAAC,QAAQ,CAChB,CAAC;IACN,CAAC;IAED;;OAEG;IACH,QAAQ,CACJ,SAAkB,EAClB,WAAuE;QAEvE,IAAI,SAAS,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,MAAM;QACF,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,GAAG,UAAuB;QACnC,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;IAC1C,CAAC;CACJ"}
|
|
@@ -64,6 +64,8 @@ export type HooksSettings<TContext extends HookContext = HookContext> = {
|
|
|
64
64
|
* The `Hooks` class provides a convenient way to change and inspect arguments and return value of both only sync functions.
|
|
65
65
|
* For example `Hooks` class can be used to log function arguments and return values. Note this class will always return promise and is immutable.
|
|
66
66
|
*
|
|
67
|
+
* Middlewares apply left to right: each wraps the next, with the leftmost being the outermost layer and the rightmost wrapping the original function.
|
|
68
|
+
*
|
|
67
69
|
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
68
70
|
* @group Hooks
|
|
69
71
|
*/
|
|
@@ -6,6 +6,8 @@ import { getInvokableName, resolveInvokable, resolveOneOrMore, } from "../../../
|
|
|
6
6
|
* The `Hooks` class provides a convenient way to change and inspect arguments and return value of both only sync functions.
|
|
7
7
|
* For example `Hooks` class can be used to log function arguments and return values. Note this class will always return promise and is immutable.
|
|
8
8
|
*
|
|
9
|
+
* Middlewares apply left to right: each wraps the next, with the leftmost being the outermost layer and the rightmost wrapping the original function.
|
|
10
|
+
*
|
|
9
11
|
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
10
12
|
* @group Hooks
|
|
11
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../src/utilities/classes/hooks/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAKnB,MAAM,gCAAgC,CAAC;AA0FxC
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../src/utilities/classes/hooks/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAKnB,MAAM,gCAAgC,CAAC;AA0FxC;;;;;;;;GAQG;AACH,MAAM,OAAO,KAAK;IAoFO;IACA;IAGA;IAlFb,MAAM,CAAC,IAAI,CAKf,SAA0C,EAC1C,WAAkE,EAClE,EACI,IAAI,GAAG,gBAAgB,CAAC,SAAS,CAAC,EAClC,OAAO,GAAG,EAAc,GACF;QAE1B,IAAI,IAAI,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACvC,KAAK,MAAM,IAAI,IAAI,gBAAgB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