ddan-js 2.5.7 → 2.5.8
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/bin/lib/modules/hook/index.js +4 -4
- package/bin/lib/modules/hook/{debounce.js → modules/debounce.js} +2 -2
- package/bin/lib/modules/hook/modules/pipeline.js +2 -2
- package/bin/lib/modules/hook/{polling.js → modules/polling.js} +1 -1
- package/bin/lib/modules/hook/{throttle.js → modules/throttle.js} +1 -1
- package/bin/types/index.d.ts +12 -12
- package/bin/types/modules/hook/index.d.ts +6 -6
- package/bin/types/modules/hook/{debounce.d.ts → modules/debounce.d.ts} +1 -1
- package/bin/types/modules/hook/{mutex.d.ts → modules/mutex.d.ts} +1 -1
- package/bin/types/modules/hook/modules/pipeline.d.ts +2 -2
- package/bin/types/modules/hook/{polling.d.ts → modules/polling.d.ts} +1 -1
- package/bin/types/modules/hook/{throttle.d.ts → modules/throttle.d.ts} +1 -1
- package/bin/types/typings/index.d.ts +1 -1
- package/package.json +1 -1
- /package/bin/lib/modules/hook/{mutex.js → modules/mutex.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const debounce_1 = require("./debounce");
|
|
4
|
-
const throttle_1 = require("./throttle");
|
|
5
|
-
const mutex_1 = require("./mutex");
|
|
3
|
+
const debounce_1 = require("./modules/debounce");
|
|
4
|
+
const throttle_1 = require("./modules/throttle");
|
|
5
|
+
const mutex_1 = require("./modules/mutex");
|
|
6
6
|
const pipeTask_1 = require("../../class/pipeTask");
|
|
7
7
|
const base_1 = require("./base");
|
|
8
|
-
const polling_1 = require("./polling");
|
|
8
|
+
const polling_1 = require("./modules/polling");
|
|
9
9
|
const hooker_1 = require("./hooker");
|
|
10
10
|
const pipeline_1 = require("./modules/pipeline");
|
|
11
11
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const to_1 = require("
|
|
4
|
-
const is_1 = require("
|
|
3
|
+
const to_1 = require("../../../util/to");
|
|
4
|
+
const is_1 = require("../../../util/is");
|
|
5
5
|
const FUNC_ERROR_TEXT = 'Expected a function';
|
|
6
6
|
const nativeMax = Math.max;
|
|
7
7
|
const nativeMin = Math.min;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const base_1 = require("
|
|
3
|
+
const base_1 = require("../base");
|
|
4
4
|
async function polling(params = {}) {
|
|
5
5
|
const { func, interval = 100, times = 1000 } = params;
|
|
6
6
|
let _times = times;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const is_1 = require("
|
|
3
|
+
const is_1 = require("../../../util/is");
|
|
4
4
|
const debounce_1 = require("./debounce");
|
|
5
5
|
/** Error message constants. */
|
|
6
6
|
const FUNC_ERROR_TEXT = 'Expected a function';
|
package/bin/types/index.d.ts
CHANGED
|
@@ -187,13 +187,13 @@ declare const dUtil: {
|
|
|
187
187
|
declare const dHook: {
|
|
188
188
|
sleep: (ms?: number) => Promise<unknown>;
|
|
189
189
|
run: <T = any>(task?: import("./typings").Ddan.PFunction<T> | undefined, wait?: number) => Promise<[any, undefined] | [null, T]>;
|
|
190
|
-
exec: (func: import("./typings").Ddan.
|
|
191
|
-
debounce: typeof import("./modules/hook/debounce").default;
|
|
192
|
-
throttle: typeof import("./modules/hook/throttle").default;
|
|
190
|
+
exec: (func: import("./typings").Ddan.Function, taskId?: string) => import("./typings").Ddan.SafeResult<any>;
|
|
191
|
+
debounce: typeof import("./modules/hook/modules/debounce").default;
|
|
192
|
+
throttle: typeof import("./modules/hook/modules/throttle").default;
|
|
193
193
|
task: (param?: import("./typings").Ddan.Func1<any, any> | undefined) => import("./class/pipeTask").default;
|
|
194
|
-
mutex: typeof import("./modules/hook/mutex").default;
|
|
195
|
-
polling: typeof import("./modules/hook/polling").default;
|
|
196
|
-
pipe: (func: import("./typings").Ddan.
|
|
194
|
+
mutex: typeof import("./modules/hook/modules/mutex").default;
|
|
195
|
+
polling: typeof import("./modules/hook/modules/polling").default;
|
|
196
|
+
pipe: (func: import("./typings").Ddan.Function) => import("./modules/hook/modules/pipeline").default;
|
|
197
197
|
pipeline: () => import("./modules/hook/modules/pipeline").default;
|
|
198
198
|
to: <T_1 = any, U extends object = any>(promise: Promise<T_1>, errorExt?: object | undefined) => Promise<[null, T_1] | [U, undefined]>;
|
|
199
199
|
go: <T_2 = any>(task?: import("./typings").Ddan.PFunction<T_2> | undefined) => Promise<[any, undefined] | [null, T_2]>;
|
|
@@ -472,13 +472,13 @@ declare const _default: {
|
|
|
472
472
|
hook: {
|
|
473
473
|
sleep: (ms?: number) => Promise<unknown>;
|
|
474
474
|
run: <T = any>(task?: import("./typings").Ddan.PFunction<T> | undefined, wait?: number) => Promise<[any, undefined] | [null, T]>;
|
|
475
|
-
exec: (func: import("./typings").Ddan.
|
|
476
|
-
debounce: typeof import("./modules/hook/debounce").default;
|
|
477
|
-
throttle: typeof import("./modules/hook/throttle").default;
|
|
475
|
+
exec: (func: import("./typings").Ddan.Function, taskId?: string) => import("./typings").Ddan.SafeResult<any>;
|
|
476
|
+
debounce: typeof import("./modules/hook/modules/debounce").default;
|
|
477
|
+
throttle: typeof import("./modules/hook/modules/throttle").default;
|
|
478
478
|
task: (param?: import("./typings").Ddan.Func1<any, any> | undefined) => import("./class/pipeTask").default;
|
|
479
|
-
mutex: typeof import("./modules/hook/mutex").default;
|
|
480
|
-
polling: typeof import("./modules/hook/polling").default;
|
|
481
|
-
pipe: (func: import("./typings").Ddan.
|
|
479
|
+
mutex: typeof import("./modules/hook/modules/mutex").default;
|
|
480
|
+
polling: typeof import("./modules/hook/modules/polling").default;
|
|
481
|
+
pipe: (func: import("./typings").Ddan.Function) => import("./modules/hook/modules/pipeline").default;
|
|
482
482
|
pipeline: () => import("./modules/hook/modules/pipeline").default;
|
|
483
483
|
to: <T_1 = any, U extends object = any>(promise: Promise<T_1>, errorExt?: object | undefined) => Promise<[null, T_1] | [U, undefined]>;
|
|
484
484
|
go: <T_2 = any>(task?: import("./typings").Ddan.PFunction<T_2> | undefined) => Promise<[any, undefined] | [null, T_2]>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Ddan } from '../../typings';
|
|
2
|
-
import debounce from './debounce';
|
|
3
|
-
import throttle from './throttle';
|
|
4
|
-
import mutex from './mutex';
|
|
2
|
+
import debounce from './modules/debounce';
|
|
3
|
+
import throttle from './modules/throttle';
|
|
4
|
+
import mutex from './modules/mutex';
|
|
5
5
|
import DPipeTask from '../../class/pipeTask';
|
|
6
|
-
import polling from './polling';
|
|
6
|
+
import polling from './modules/polling';
|
|
7
7
|
import DPipeline from './modules/pipeline';
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
@@ -15,13 +15,13 @@ declare function run<T = any>(task?: Ddan.PFunction<T>, wait?: number): Promise<
|
|
|
15
15
|
declare const _default: {
|
|
16
16
|
sleep: (ms?: number) => Promise<unknown>;
|
|
17
17
|
run: typeof run;
|
|
18
|
-
exec: (func: Ddan.
|
|
18
|
+
exec: (func: Ddan.Function, taskId?: string) => Ddan.SafeResult<any>;
|
|
19
19
|
debounce: typeof debounce;
|
|
20
20
|
throttle: typeof throttle;
|
|
21
21
|
task: (param?: Ddan.Func1<any, any> | undefined) => DPipeTask;
|
|
22
22
|
mutex: typeof mutex;
|
|
23
23
|
polling: typeof polling;
|
|
24
|
-
pipe: (func: Ddan.
|
|
24
|
+
pipe: (func: Ddan.Function) => DPipeline;
|
|
25
25
|
pipeline: () => DPipeline;
|
|
26
26
|
to: <T = any, U extends object = any>(promise: Promise<T>, errorExt?: object | undefined) => Promise<[null, T] | [U, undefined]>;
|
|
27
27
|
go: <T_1 = any>(task?: Ddan.PFunction<T_1> | undefined) => Promise<[any, undefined] | [null, T_1]>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Ddan } from '../../../typings';
|
|
2
2
|
export default class DPipeline implements Ddan.IPipeline {
|
|
3
|
-
__list: Ddan.
|
|
3
|
+
__list: Ddan.Function[];
|
|
4
4
|
__running: boolean;
|
|
5
5
|
__waitting: boolean;
|
|
6
6
|
constructor();
|
|
7
|
-
pipe(
|
|
7
|
+
pipe(func?: Ddan.Function): this;
|
|
8
8
|
delay(t?: number): this;
|
|
9
9
|
clear(): this;
|
|
10
10
|
_step(): Promise<void>;
|
package/package.json
CHANGED
|
File without changes
|