iterable-linq-utility 0.0.3 → 0.0.5
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/{filter.d.ts → functions/filter.d.ts} +1 -1
- package/dist/functions/index.d.ts +8 -0
- package/dist/{map.d.ts → functions/map.d.ts} +1 -1
- package/dist/{materialize.d.ts → functions/materialize.d.ts} +0 -0
- package/dist/{max.d.ts → functions/max.d.ts} +0 -0
- package/dist/{memoize.d.ts → functions/memoize.d.ts} +0 -0
- package/dist/functions/min.d.ts +2 -0
- package/dist/functions/range.d.ts +6 -0
- package/dist/{some.d.ts → functions/some.d.ts} +0 -0
- package/dist/genericCollections/index.d.ts +1 -0
- package/dist/{linkedList.d.ts → genericCollections/linkedList.d.ts} +0 -0
- package/dist/index.d.ts +2 -20
- package/dist/interable-linq-utility.js +109 -126
- package/dist/interable-linq-utility.umd.cjs +1 -1
- package/dist/linqIterable.d.ts +16 -2
- package/dist/utils/index.d.ts +1 -0
- package/dist/{iteratorResults.d.ts → utils/iteratorResults.d.ts} +0 -0
- package/package.json +3 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Predicate } from "
|
|
1
|
+
import { Predicate } from "@/types";
|
|
2
2
|
export declare function filter<T>(iterable: Iterable<T>, predicate: Predicate<T>): Iterable<T>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Mapper } from "
|
|
1
|
+
import { Mapper } from "@/types";
|
|
2
2
|
export declare function map<T, R>(iterable: Iterable<T>, mapper: Mapper<T, R>): Iterable<R>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function range(end: number): Iterable<number>;
|
|
2
|
+
export declare function range(end: number, reverse?: boolean): Iterable<number>;
|
|
3
|
+
export declare function range(start: number, end: number): Iterable<number>;
|
|
4
|
+
export declare function range(start: number, end: number, step: number): Iterable<number>;
|
|
5
|
+
export declare function range(start: number, end: number, reverse: boolean): Iterable<number>;
|
|
6
|
+
export declare function range(start: number, end: number, step: number, reverse: boolean): Iterable<number>;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './linkedList';
|
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
[Symbol.iterator](): Iterator<T, any, undefined>;
|
|
3
|
-
collectToArray(): T[];
|
|
4
|
-
filter(predicate: (value: T, index: number) => boolean): ILinqIterable<T>;
|
|
5
|
-
map<R>(mapper: (value: T, index: number) => R): ILinqIterable<R>;
|
|
6
|
-
materialize(): ILinqIterable<T>;
|
|
7
|
-
max<T>(comparer?: (a: T, b: T, index: number) => boolean): T | null | undefined;
|
|
8
|
-
memoize(): ILinqIterable<T>;
|
|
9
|
-
some(predicate: (value: T, index: number) => boolean): boolean;
|
|
10
|
-
}
|
|
11
|
-
declare module "./linqIterable" {
|
|
12
|
-
interface LinqIterable<T> {
|
|
13
|
-
filter(predicate: (value: T, index: number) => boolean): ILinqIterable<T>;
|
|
14
|
-
map<R>(mapper: (value: T, index: number) => R): ILinqIterable<R>;
|
|
15
|
-
materialize(): ILinqIterable<T>;
|
|
16
|
-
max<T>(comparer?: (a: T, b: T, index: number) => boolean): T | null | undefined;
|
|
17
|
-
memoize(): ILinqIterable<T>;
|
|
18
|
-
some(predicate: (value: T, index: number) => boolean): boolean;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
import { type ILinqIterable } from "./linqIterable";
|
|
21
2
|
export declare function from<T>(iterable: Iterable<T>): ILinqIterable<T>;
|
|
3
|
+
export { ILinqIterable };
|
|
@@ -1,59 +1,44 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
o(this, "iterable");
|
|
7
|
-
this.iterable = t;
|
|
8
|
-
}
|
|
9
|
-
[Symbol.iterator]() {
|
|
10
|
-
return this.iterable[Symbol.iterator]();
|
|
11
|
-
}
|
|
12
|
-
source() {
|
|
13
|
-
return this.iterable;
|
|
14
|
-
}
|
|
15
|
-
collectToArray() {
|
|
16
|
-
return [...this.source()];
|
|
17
|
-
}
|
|
1
|
+
var I = Object.defineProperty;
|
|
2
|
+
var p = (e, t, r) => t in e ? I(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var i = (e, t, r) => (p(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
function z(e, t) {
|
|
5
|
+
return (r, s) => t(e(r, s), s);
|
|
18
6
|
}
|
|
19
|
-
function
|
|
20
|
-
return (r,
|
|
7
|
+
function x(e, t) {
|
|
8
|
+
return (r, s) => e(r, s) && t(r, s);
|
|
21
9
|
}
|
|
22
|
-
function
|
|
23
|
-
return (r, i) => e(r, i) && t(r, i);
|
|
24
|
-
}
|
|
25
|
-
function f(e, t) {
|
|
10
|
+
function m(e, t) {
|
|
26
11
|
return {
|
|
27
12
|
done: e,
|
|
28
13
|
value: t
|
|
29
14
|
};
|
|
30
15
|
}
|
|
31
|
-
function
|
|
16
|
+
function f() {
|
|
32
17
|
return { done: !0, value: void 0 };
|
|
33
18
|
}
|
|
34
|
-
function
|
|
35
|
-
return new
|
|
19
|
+
function w(e, t) {
|
|
20
|
+
return new c(e, t);
|
|
36
21
|
}
|
|
37
|
-
class
|
|
22
|
+
class c {
|
|
38
23
|
constructor(t, r) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
let
|
|
42
|
-
if (n instanceof
|
|
43
|
-
const
|
|
44
|
-
n = n.source,
|
|
24
|
+
i(this, "predicate");
|
|
25
|
+
i(this, "source");
|
|
26
|
+
let s = r, n = t;
|
|
27
|
+
if (n instanceof c) {
|
|
28
|
+
const u = n.predicate;
|
|
29
|
+
n = n.source, s = x(u, s);
|
|
45
30
|
}
|
|
46
|
-
this.source = n, this.predicate =
|
|
31
|
+
this.source = n, this.predicate = s;
|
|
47
32
|
}
|
|
48
33
|
[Symbol.iterator]() {
|
|
49
|
-
return new
|
|
34
|
+
return new S(this.source, this.predicate);
|
|
50
35
|
}
|
|
51
36
|
}
|
|
52
|
-
class
|
|
37
|
+
class S {
|
|
53
38
|
constructor(t, r) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
39
|
+
i(this, "index", 0);
|
|
40
|
+
i(this, "sourceIterator");
|
|
41
|
+
i(this, "predicate");
|
|
57
42
|
this.sourceIterator = t[Symbol.iterator](), this.predicate = r;
|
|
58
43
|
}
|
|
59
44
|
next() {
|
|
@@ -64,60 +49,60 @@ class M {
|
|
|
64
49
|
}
|
|
65
50
|
}
|
|
66
51
|
}
|
|
67
|
-
function
|
|
68
|
-
return new
|
|
52
|
+
function b(e, t) {
|
|
53
|
+
return new l(e, t);
|
|
69
54
|
}
|
|
70
|
-
class
|
|
55
|
+
class l {
|
|
71
56
|
constructor(t, r) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
let
|
|
75
|
-
if (n instanceof
|
|
76
|
-
const
|
|
77
|
-
n = n.source,
|
|
57
|
+
i(this, "mapper");
|
|
58
|
+
i(this, "source");
|
|
59
|
+
let s = r, n = t;
|
|
60
|
+
if (n instanceof l) {
|
|
61
|
+
const u = n.mapper;
|
|
62
|
+
n = n.source, s = z(u, s);
|
|
78
63
|
}
|
|
79
|
-
this.source = t, this.mapper =
|
|
64
|
+
this.source = t, this.mapper = s;
|
|
80
65
|
}
|
|
81
66
|
[Symbol.iterator]() {
|
|
82
|
-
return new
|
|
67
|
+
return new M(this.source, this.mapper);
|
|
83
68
|
}
|
|
84
69
|
}
|
|
85
|
-
class
|
|
70
|
+
class M {
|
|
86
71
|
constructor(t, r) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
72
|
+
i(this, "index", 0);
|
|
73
|
+
i(this, "sourceIterator");
|
|
74
|
+
i(this, "mapper");
|
|
90
75
|
this.sourceIterator = t[Symbol.iterator](), this.mapper = r;
|
|
91
76
|
}
|
|
92
77
|
next() {
|
|
93
78
|
const t = this.sourceIterator.next();
|
|
94
|
-
return t.done !== !0 ?
|
|
79
|
+
return t.done !== !0 ? m(!1, this.mapper(t.value, this.index++)) : f();
|
|
95
80
|
}
|
|
96
81
|
}
|
|
97
|
-
function
|
|
82
|
+
function y(e) {
|
|
98
83
|
const t = e[Symbol.iterator](), r = new a();
|
|
99
|
-
for (let
|
|
100
|
-
r.addLast(
|
|
84
|
+
for (let s = t.next(); s.done !== !0; s = t.next())
|
|
85
|
+
r.addLast(s.value);
|
|
101
86
|
return r;
|
|
102
87
|
}
|
|
103
|
-
class
|
|
88
|
+
class k {
|
|
104
89
|
constructor(t = null) {
|
|
105
|
-
|
|
90
|
+
i(this, "current", null);
|
|
106
91
|
this.current = t;
|
|
107
92
|
}
|
|
108
93
|
next() {
|
|
109
94
|
const t = this.current;
|
|
110
|
-
return t === null ?
|
|
95
|
+
return t === null ? f() : (this.current = t.nextNode, m(!1, t.data));
|
|
111
96
|
}
|
|
112
97
|
}
|
|
113
98
|
class a {
|
|
114
99
|
constructor() {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
100
|
+
i(this, "internalSize", 0);
|
|
101
|
+
i(this, "head", null);
|
|
102
|
+
i(this, "tail", null);
|
|
118
103
|
}
|
|
119
104
|
[Symbol.iterator]() {
|
|
120
|
-
return new
|
|
105
|
+
return new k(this.head);
|
|
121
106
|
}
|
|
122
107
|
addFirst(t) {
|
|
123
108
|
const r = {
|
|
@@ -151,65 +136,54 @@ class a {
|
|
|
151
136
|
return this.internalSize;
|
|
152
137
|
}
|
|
153
138
|
}
|
|
154
|
-
function
|
|
155
|
-
return e instanceof
|
|
139
|
+
function L(e) {
|
|
140
|
+
return e instanceof h ? e : new h(e);
|
|
156
141
|
}
|
|
157
|
-
class
|
|
142
|
+
class h {
|
|
158
143
|
constructor(t) {
|
|
159
|
-
|
|
144
|
+
i(this, "source");
|
|
160
145
|
if (t instanceof a) {
|
|
161
146
|
this.source = t;
|
|
162
147
|
return;
|
|
163
148
|
}
|
|
164
|
-
this.source =
|
|
149
|
+
this.source = y(t);
|
|
165
150
|
}
|
|
166
151
|
[Symbol.iterator]() {
|
|
167
|
-
return new
|
|
152
|
+
return new N(this.source);
|
|
168
153
|
}
|
|
169
154
|
}
|
|
170
|
-
class
|
|
155
|
+
class N {
|
|
171
156
|
constructor(t) {
|
|
172
|
-
|
|
157
|
+
i(this, "sourceIterator");
|
|
173
158
|
this.sourceIterator = t[Symbol.iterator]();
|
|
174
159
|
}
|
|
175
160
|
next() {
|
|
176
161
|
return this.sourceIterator.next();
|
|
177
162
|
}
|
|
178
163
|
}
|
|
179
|
-
function
|
|
180
|
-
return
|
|
181
|
-
}
|
|
182
|
-
function R(e, t) {
|
|
183
|
-
const r = e[Symbol.iterator]();
|
|
184
|
-
let i = 0, n = r.next(), s = n.value;
|
|
185
|
-
const I = P(t) ? t : (x, z) => x > z;
|
|
186
|
-
for (n = r.next(); n.done !== !0; n = r.next())
|
|
187
|
-
s = I(s, n.value, i++) ? s : n.value;
|
|
188
|
-
return s == null ? null : s;
|
|
189
|
-
}
|
|
190
|
-
function q(e) {
|
|
191
|
-
return e instanceof m ? e : new m(e);
|
|
164
|
+
function v(e) {
|
|
165
|
+
return e instanceof d ? e : new d(e);
|
|
192
166
|
}
|
|
193
|
-
class
|
|
167
|
+
class d {
|
|
194
168
|
constructor(t) {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
169
|
+
i(this, "isMemoized", !1);
|
|
170
|
+
i(this, "sourceIterator");
|
|
171
|
+
i(this, "linkedList", new a());
|
|
172
|
+
i(this, "source");
|
|
199
173
|
this.source = t, this.sourceIterator = t[Symbol.iterator](), t instanceof a && (this.linkedList = t, this.isMemoized = !0);
|
|
200
174
|
}
|
|
201
175
|
[Symbol.iterator]() {
|
|
202
|
-
return this.isMemoized ? new
|
|
176
|
+
return this.isMemoized ? new g(this.linkedList) : new A(this.sourceIterator, this.linkedList, (t) => this.isMemoized = t.done === !0);
|
|
203
177
|
}
|
|
204
178
|
}
|
|
205
|
-
class
|
|
206
|
-
constructor(t, r,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
this.linkedList = r, this.linkedListIterator = r[Symbol.iterator](), this.setAsMemoized =
|
|
179
|
+
class A {
|
|
180
|
+
constructor(t, r, s) {
|
|
181
|
+
i(this, "index", 0);
|
|
182
|
+
i(this, "linkedList");
|
|
183
|
+
i(this, "linkedListIterator");
|
|
184
|
+
i(this, "setAsMemoized");
|
|
185
|
+
i(this, "sourceIterator");
|
|
186
|
+
this.linkedList = r, this.linkedListIterator = r[Symbol.iterator](), this.setAsMemoized = s, this.sourceIterator = t;
|
|
213
187
|
}
|
|
214
188
|
next() {
|
|
215
189
|
if (this.linkedList.size() > this.index++)
|
|
@@ -218,44 +192,53 @@ class D {
|
|
|
218
192
|
return this.setAsMemoized(t) || this.linkedList.addLast(t.value), t;
|
|
219
193
|
}
|
|
220
194
|
}
|
|
221
|
-
class
|
|
195
|
+
class g {
|
|
222
196
|
constructor(t) {
|
|
223
|
-
|
|
197
|
+
i(this, "memoizedSourceIterator");
|
|
224
198
|
this.memoizedSourceIterator = t[Symbol.iterator]();
|
|
225
199
|
}
|
|
226
200
|
next() {
|
|
227
201
|
return this.memoizedSourceIterator.next();
|
|
228
202
|
}
|
|
229
203
|
}
|
|
230
|
-
function
|
|
204
|
+
function F(e, t) {
|
|
231
205
|
const r = e[Symbol.iterator]();
|
|
232
|
-
let
|
|
206
|
+
let s = 0;
|
|
233
207
|
for (let n = r.next(); n.done !== !0; n = r.next())
|
|
234
|
-
if (t(n.value,
|
|
208
|
+
if (t(n.value, s++))
|
|
235
209
|
return !0;
|
|
236
210
|
return !1;
|
|
237
211
|
}
|
|
238
|
-
|
|
239
|
-
|
|
212
|
+
class o {
|
|
213
|
+
constructor(t) {
|
|
214
|
+
i(this, "iterable");
|
|
215
|
+
this.iterable = t;
|
|
216
|
+
}
|
|
217
|
+
[Symbol.iterator]() {
|
|
218
|
+
return this.iterable[Symbol.iterator]();
|
|
219
|
+
}
|
|
220
|
+
collectToArray() {
|
|
221
|
+
return [...this.iterable];
|
|
222
|
+
}
|
|
223
|
+
filter(t) {
|
|
224
|
+
return new o(w(this.iterable, t));
|
|
225
|
+
}
|
|
226
|
+
map(t) {
|
|
227
|
+
return new o(b(this.iterable, t));
|
|
228
|
+
}
|
|
229
|
+
materialize() {
|
|
230
|
+
return new o(L(this.iterable));
|
|
231
|
+
}
|
|
232
|
+
memoize() {
|
|
233
|
+
return new o(v(this.iterable));
|
|
234
|
+
}
|
|
235
|
+
some(t) {
|
|
236
|
+
return F(this.iterable, t);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
function R(e) {
|
|
240
|
+
return new o(e);
|
|
240
241
|
}
|
|
241
|
-
u.prototype.filter = function(e) {
|
|
242
|
-
return c(L(this.source(), e));
|
|
243
|
-
};
|
|
244
|
-
u.prototype.map = function(e) {
|
|
245
|
-
return c(k(this.source(), e));
|
|
246
|
-
};
|
|
247
|
-
u.prototype.materialize = function() {
|
|
248
|
-
return c(F(this.source()));
|
|
249
|
-
};
|
|
250
|
-
u.prototype.max = function(e) {
|
|
251
|
-
return R(this.source(), e);
|
|
252
|
-
};
|
|
253
|
-
u.prototype.memoize = function() {
|
|
254
|
-
return c(q(this.source()));
|
|
255
|
-
};
|
|
256
|
-
u.prototype.some = function(e) {
|
|
257
|
-
return $(this.source(), e);
|
|
258
|
-
};
|
|
259
242
|
export {
|
|
260
|
-
|
|
243
|
+
R as from
|
|
261
244
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(a,o){typeof exports=="object"&&typeof module<"u"?o(exports):typeof define=="function"&&define.amd?define(["exports"],o):(a=typeof globalThis<"u"?globalThis:a||self,o(a["interable-linq-utility"]={}))})(this,function(a){"use strict";var T=Object.defineProperty;var F=(a,o,u)=>o in a?T(a,o,{enumerable:!0,configurable:!0,writable:!0,value:u}):a[o]=u;var i=(a,o,u)=>(F(a,typeof o!="symbol"?o+"":o,u),u);function o(e,t){return(r,n)=>t(e(r,n),n)}function u(e,t){return(r,n)=>e(r,n)&&t(r,n)}function f(e,t){return{done:e,value:t}}function p(){return{done:!0,value:void 0}}function R(e){return e}function x(e,t){return new d(e,t)}class d{constructor(t,r){i(this,"predicate");i(this,"source");let n=r,s=t;if(s instanceof d){const m=s.predicate;s=s.source,n=u(m,n)}this.source=s,this.predicate=n}[Symbol.iterator](){return new S(this.source,this.predicate)}}class S{constructor(t,r){i(this,"index",0);i(this,"sourceIterator");i(this,"predicate");this.sourceIterator=t[Symbol.iterator](),this.predicate=r}next(){for(;;){const t=this.sourceIterator.next();if(t.done===!0||this.predicate(t.value,this.index++))return t}}}function b(e,t){return new h(e,t)}class h{constructor(t,r){i(this,"mapper");i(this,"source");let n=r,s=t;if(s instanceof h){const m=s.mapper;s=s.source,n=o(m,n)}this.source=t,this.mapper=n}[Symbol.iterator](){return new w(this.source,this.mapper)}}class w{constructor(t,r){i(this,"index",0);i(this,"sourceIterator");i(this,"mapper");this.sourceIterator=t[Symbol.iterator](),this.mapper=r}next(){const t=this.sourceIterator.next();return t.done!==!0?f(!1,this.mapper(t.value,this.index++)):p()}}function y(e){const t=e[Symbol.iterator](),r=new l;for(let n=t.next();n.done!==!0;n=t.next())r.addLast(n.value);return r}class M{constructor(t=null){i(this,"current",null);this.current=t}next(){const t=this.current;return t===null?p():(this.current=t.nextNode,f(!1,t.data))}}class l{constructor(){i(this,"internalSize",0);i(this,"head",null);i(this,"tail",null)}[Symbol.iterator](){return new M(this.head)}addFirst(t){const r={data:t,nextNode:null};switch(this.internalSize){case 0:this.head=r,this.tail=r;break;default:r.nextNode=this.head,this.head=r}return this.internalSize++,this}addLast(t){const r={data:t,nextNode:null};switch(this.internalSize){case 0:this.head=r,this.tail=r;break;default:this.tail.nextNode=r,this.tail=r}return this.internalSize++,this}size(){return this.internalSize}}function k(e){return e instanceof I?e:new I(e)}class I{constructor(t){i(this,"source");if(t instanceof l){this.source=t;return}this.source=y(t)}[Symbol.iterator](){return new L(this.source)}}class L{constructor(t){i(this,"sourceIterator");this.sourceIterator=t[Symbol.iterator]()}next(){return this.sourceIterator.next()}}function v(e){return e instanceof z?e:new z(e)}class z{constructor(t){i(this,"isMemoized",!1);i(this,"sourceIterator");i(this,"linkedList",new l);i(this,"source");this.source=t,this.sourceIterator=t[Symbol.iterator](),t instanceof l&&(this.linkedList=t,this.isMemoized=!0)}[Symbol.iterator](){return this.isMemoized?new g(this.linkedList):new N(this.sourceIterator,this.linkedList,t=>this.isMemoized=t.done===!0)}}class N{constructor(t,r,n){i(this,"index",0);i(this,"linkedList");i(this,"linkedListIterator");i(this,"setAsMemoized");i(this,"sourceIterator");this.linkedList=r,this.linkedListIterator=r[Symbol.iterator](),this.setAsMemoized=n,this.sourceIterator=t}next(){if(this.linkedList.size()>this.index++)return this.linkedListIterator.next();const t=this.sourceIterator.next();return this.setAsMemoized(t)||this.linkedList.addLast(t.value),t}}class g{constructor(t){i(this,"memoizedSourceIterator");this.memoizedSourceIterator=t[Symbol.iterator]()}next(){return this.memoizedSourceIterator.next()}}function A(e,t){const r=e[Symbol.iterator]();let n=0;for(let s=r.next();s.done!==!0;s=r.next())if(t(s.value,n++))return!0;return!1}class c{constructor(t){i(this,"iterable");this.iterable=t}[Symbol.iterator](){return this.iterable[Symbol.iterator]()}collectToArray(){return[...this.iterable]}filter(t){return new c(x(this.iterable,t))}map(t){return new c(b(this.iterable,t))}materialize(){return new c(k(this.iterable))}memoize(){return new c(v(this.iterable))}some(t){return A(this.iterable,t)}}function P(e){return new c(e)}a.from=P,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/linqIterable.d.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import { Mapper, Predicate } from '@/types';
|
|
2
|
+
export interface ILinqIterable<T> {
|
|
3
|
+
[Symbol.iterator](): Iterator<T, any, undefined>;
|
|
4
|
+
collectToArray(): T[];
|
|
5
|
+
filter(predicate: Predicate<T>): ILinqIterable<T>;
|
|
6
|
+
map<R>(mapper: Mapper<T, R>): ILinqIterable<R>;
|
|
7
|
+
materialize(): ILinqIterable<T>;
|
|
8
|
+
memoize(): ILinqIterable<T>;
|
|
9
|
+
some(predicate: (value: T, index: number) => boolean): boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class LinqIterable<T> implements ILinqIterable<T> {
|
|
2
12
|
constructor(iterable: Iterable<T>);
|
|
3
13
|
[Symbol.iterator](): Iterator<T, any, undefined>;
|
|
4
14
|
private iterable;
|
|
5
|
-
source(): Iterable<T>;
|
|
6
15
|
collectToArray(): T[];
|
|
16
|
+
filter(predicate: Predicate<T>): ILinqIterable<T>;
|
|
17
|
+
map<R>(mapper: Mapper<T, R>): ILinqIterable<R>;
|
|
18
|
+
materialize(): ILinqIterable<T>;
|
|
19
|
+
memoize(): ILinqIterable<T>;
|
|
20
|
+
some(predicate: (value: T, index: number) => boolean): boolean;
|
|
7
21
|
}
|
package/dist/utils/index.d.ts
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iterable-linq-utility",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "An Iterable mutation utility inspired by .net Linq and Javascript Array interface",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/my-lib.umd.cjs",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "tsc && vite build",
|
|
19
|
+
"build": "tsc -p tsconfig.build.json && vite build",
|
|
20
20
|
"dev": "vite",
|
|
21
21
|
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --ignore-path .eslintignore",
|
|
22
22
|
"lint-fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix --ignore-path .eslintignore",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"typescript": "4.9.3",
|
|
50
50
|
"vite": "3.2.4",
|
|
51
51
|
"vite-plugin-dts": "1.7.1",
|
|
52
|
+
"vite-tsconfig-paths": "3.6.0",
|
|
52
53
|
"vitest": "0.25.3"
|
|
53
54
|
}
|
|
54
55
|
}
|