@zwa73/utils 1.0.191 → 1.0.192
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/UtilClass.d.ts +3 -1
- package/dist/UtilClass.js +6 -2
- package/package.json +1 -1
- package/src/UtilClass.ts +6 -2
package/dist/UtilClass.d.ts
CHANGED
|
@@ -28,7 +28,9 @@ export declare class Stream<T> implements Iterable<T> {
|
|
|
28
28
|
private _operation;
|
|
29
29
|
private constructor();
|
|
30
30
|
/**从arraylike创建流 */
|
|
31
|
-
static from<T>(
|
|
31
|
+
static from<T>(args: Parameters<typeof Array.from<T>>[0], concurrent?: number): Stream<T>;
|
|
32
|
+
/**从数组创建流 */
|
|
33
|
+
static of<T>(...args: T[]): Stream<T>;
|
|
32
34
|
/**设置并发数 */
|
|
33
35
|
concurrent(count: number): Stream<T>;
|
|
34
36
|
/**平分数组
|
package/dist/UtilClass.js
CHANGED
|
@@ -50,8 +50,12 @@ class Stream {
|
|
|
50
50
|
this._concurrent = concurrent;
|
|
51
51
|
}
|
|
52
52
|
/**从arraylike创建流 */
|
|
53
|
-
static from(
|
|
54
|
-
return new Stream(Array.from(
|
|
53
|
+
static from(args, concurrent = 1) {
|
|
54
|
+
return new Stream(Array.from(args), concurrent);
|
|
55
|
+
}
|
|
56
|
+
/**从数组创建流 */
|
|
57
|
+
static of(...args) {
|
|
58
|
+
return new Stream(args);
|
|
55
59
|
}
|
|
56
60
|
/**设置并发数 */
|
|
57
61
|
concurrent(count) {
|
package/package.json
CHANGED
package/src/UtilClass.ts
CHANGED
|
@@ -53,8 +53,12 @@ export class Stream<T> implements Iterable<T>{
|
|
|
53
53
|
this._concurrent = concurrent;
|
|
54
54
|
}
|
|
55
55
|
/**从arraylike创建流 */
|
|
56
|
-
static from<T>(
|
|
57
|
-
return new Stream<T>(Array.from(
|
|
56
|
+
static from<T>(args:Parameters<typeof Array.from<T>>[0],concurrent:number=1){
|
|
57
|
+
return new Stream<T>(Array.from(args),concurrent);
|
|
58
|
+
}
|
|
59
|
+
/**从数组创建流 */
|
|
60
|
+
static of<T>(...args:T[]){
|
|
61
|
+
return new Stream<T>(args);
|
|
58
62
|
}
|
|
59
63
|
/**设置并发数 */
|
|
60
64
|
concurrent(count: number): Stream<T> {
|