iterable-linq-utility 0.0.2 → 0.0.4

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