iterable-linq-utility 0.0.8 → 0.0.9

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