inqjs 1.0.1 → 1.0.2

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.
Files changed (180) hide show
  1. package/dist/Query.d.ts +31 -0
  2. package/dist/Query.d.ts.map +1 -0
  3. package/dist/Query.js.map +1 -0
  4. package/dist/async/AsyncQuery.d.ts +28 -0
  5. package/dist/async/AsyncQuery.d.ts.map +1 -0
  6. package/dist/async/AsyncQuery.js +138 -0
  7. package/dist/async/AsyncQuery.js.map +1 -0
  8. package/dist/async/operators/allAsync.d.ts +2 -0
  9. package/dist/async/operators/allAsync.d.ts.map +1 -0
  10. package/dist/async/operators/allAsync.js +12 -0
  11. package/dist/async/operators/allAsync.js.map +1 -0
  12. package/dist/async/operators/anyAsync.d.ts +2 -0
  13. package/dist/async/operators/anyAsync.d.ts.map +1 -0
  14. package/dist/async/operators/anyAsync.js +18 -0
  15. package/dist/async/operators/anyAsync.js.map +1 -0
  16. package/dist/async/operators/appendAsync.d.ts +2 -0
  17. package/dist/async/operators/appendAsync.d.ts.map +1 -0
  18. package/dist/async/operators/appendAsync.js +8 -0
  19. package/dist/async/operators/appendAsync.js.map +1 -0
  20. package/dist/async/operators/concatAsync.d.ts +2 -0
  21. package/dist/async/operators/concatAsync.d.ts.map +1 -0
  22. package/dist/async/operators/concatAsync.js +8 -0
  23. package/dist/async/operators/concatAsync.js.map +1 -0
  24. package/dist/async/operators/countAsync.d.ts +2 -0
  25. package/dist/async/operators/countAsync.d.ts.map +1 -0
  26. package/dist/async/operators/countAsync.js +13 -0
  27. package/dist/async/operators/countAsync.js.map +1 -0
  28. package/dist/async/operators/distinctAsync.d.ts +2 -0
  29. package/dist/async/operators/distinctAsync.d.ts.map +1 -0
  30. package/dist/async/operators/distinctAsync.js +14 -0
  31. package/dist/async/operators/distinctAsync.js.map +1 -0
  32. package/dist/async/operators/exceptAsync.d.ts +2 -0
  33. package/dist/async/operators/exceptAsync.d.ts.map +1 -0
  34. package/dist/async/operators/exceptAsync.js +18 -0
  35. package/dist/async/operators/exceptAsync.js.map +1 -0
  36. package/dist/async/operators/firstAsync.d.ts +2 -0
  37. package/dist/async/operators/firstAsync.d.ts.map +1 -0
  38. package/dist/async/operators/firstAsync.js +21 -0
  39. package/dist/async/operators/firstAsync.js.map +1 -0
  40. package/dist/async/operators/intersectAsync.d.ts +2 -0
  41. package/dist/async/operators/intersectAsync.d.ts.map +1 -0
  42. package/dist/async/operators/intersectAsync.js +18 -0
  43. package/dist/async/operators/intersectAsync.js.map +1 -0
  44. package/dist/async/operators/maxAsync.d.ts +2 -0
  45. package/dist/async/operators/maxAsync.d.ts.map +1 -0
  46. package/dist/async/operators/maxAsync.js +17 -0
  47. package/dist/async/operators/maxAsync.js.map +1 -0
  48. package/dist/async/operators/minAsync.d.ts +2 -0
  49. package/dist/async/operators/minAsync.d.ts.map +1 -0
  50. package/dist/async/operators/minAsync.js +17 -0
  51. package/dist/async/operators/minAsync.js.map +1 -0
  52. package/dist/async/operators/orderByAsync.d.ts +2 -0
  53. package/dist/async/operators/orderByAsync.d.ts.map +1 -0
  54. package/dist/async/operators/orderByAsync.js +19 -0
  55. package/dist/async/operators/orderByAsync.js.map +1 -0
  56. package/dist/async/operators/prependAsync.d.ts +2 -0
  57. package/dist/async/operators/prependAsync.d.ts.map +1 -0
  58. package/dist/async/operators/prependAsync.js +8 -0
  59. package/dist/async/operators/prependAsync.js.map +1 -0
  60. package/dist/async/operators/selectAsync.d.ts +2 -0
  61. package/dist/async/operators/selectAsync.d.ts.map +1 -0
  62. package/dist/async/operators/selectAsync.js +10 -0
  63. package/dist/async/operators/selectAsync.js.map +1 -0
  64. package/dist/async/operators/skipAsync.d.ts +2 -0
  65. package/dist/async/operators/skipAsync.d.ts.map +1 -0
  66. package/dist/async/operators/skipAsync.js +14 -0
  67. package/dist/async/operators/skipAsync.js.map +1 -0
  68. package/dist/async/operators/sumAsync.d.ts +2 -0
  69. package/dist/async/operators/sumAsync.d.ts.map +1 -0
  70. package/dist/async/operators/sumAsync.js +15 -0
  71. package/dist/async/operators/sumAsync.js.map +1 -0
  72. package/dist/async/operators/takeAsync.d.ts +2 -0
  73. package/dist/async/operators/takeAsync.d.ts.map +1 -0
  74. package/dist/async/operators/takeAsync.js +13 -0
  75. package/dist/async/operators/takeAsync.js.map +1 -0
  76. package/dist/async/operators/toArrayAsync.d.ts +2 -0
  77. package/dist/async/operators/toArrayAsync.d.ts.map +1 -0
  78. package/dist/async/operators/toArrayAsync.js +11 -0
  79. package/dist/async/operators/toArrayAsync.js.map +1 -0
  80. package/dist/async/operators/unionAsync.d.ts +2 -0
  81. package/dist/async/operators/unionAsync.d.ts.map +1 -0
  82. package/dist/async/operators/unionAsync.js +21 -0
  83. package/dist/async/operators/unionAsync.js.map +1 -0
  84. package/dist/async/operators/whereAsync.d.ts +2 -0
  85. package/dist/async/operators/whereAsync.d.ts.map +1 -0
  86. package/dist/async/operators/whereAsync.js +12 -0
  87. package/dist/async/operators/whereAsync.js.map +1 -0
  88. package/dist/json/fromJson.d.ts +20 -0
  89. package/dist/json/fromJson.d.ts.map +1 -0
  90. package/dist/json/fromJson.js +49 -0
  91. package/dist/json/fromJson.js.map +1 -0
  92. package/dist/operators/all.d.ts +2 -0
  93. package/dist/operators/all.d.ts.map +1 -0
  94. package/dist/operators/all.js +12 -0
  95. package/dist/operators/all.js.map +1 -0
  96. package/dist/operators/any.d.ts +2 -0
  97. package/dist/operators/any.d.ts.map +1 -0
  98. package/dist/operators/any.js +17 -0
  99. package/dist/operators/any.js.map +1 -0
  100. package/dist/operators/append.d.ts +2 -0
  101. package/dist/operators/append.d.ts.map +1 -0
  102. package/dist/operators/append.js +8 -0
  103. package/dist/operators/append.js.map +1 -0
  104. package/dist/operators/concat.d.ts +2 -0
  105. package/dist/operators/concat.d.ts.map +1 -0
  106. package/dist/operators/concat.js +8 -0
  107. package/dist/operators/concat.js.map +1 -0
  108. package/dist/operators/count.d.ts +2 -0
  109. package/dist/operators/count.d.ts.map +1 -0
  110. package/dist/operators/count.js +13 -0
  111. package/dist/operators/count.js.map +1 -0
  112. package/dist/operators/distinct.d.ts +2 -0
  113. package/dist/operators/distinct.d.ts.map +1 -0
  114. package/dist/operators/distinct.js +14 -0
  115. package/dist/operators/distinct.js.map +1 -0
  116. package/dist/operators/except.d.ts +2 -0
  117. package/dist/operators/except.d.ts.map +1 -0
  118. package/dist/operators/except.js +18 -0
  119. package/dist/operators/except.js.map +1 -0
  120. package/dist/operators/first.d.ts +2 -0
  121. package/dist/operators/first.d.ts.map +1 -0
  122. package/dist/operators/first.js +21 -0
  123. package/dist/operators/first.js.map +1 -0
  124. package/dist/operators/intersect.d.ts +2 -0
  125. package/dist/operators/intersect.d.ts.map +1 -0
  126. package/dist/operators/intersect.js +18 -0
  127. package/dist/operators/intersect.js.map +1 -0
  128. package/dist/operators/max.d.ts +2 -0
  129. package/dist/operators/max.d.ts.map +1 -0
  130. package/dist/operators/max.js +17 -0
  131. package/dist/operators/max.js.map +1 -0
  132. package/dist/operators/min.d.ts +2 -0
  133. package/dist/operators/min.d.ts.map +1 -0
  134. package/dist/operators/min.js +17 -0
  135. package/dist/operators/min.js.map +1 -0
  136. package/dist/operators/orderBy.d.ts +2 -0
  137. package/dist/operators/orderBy.d.ts.map +1 -0
  138. package/dist/operators/orderBy.js +15 -0
  139. package/dist/operators/orderBy.js.map +1 -0
  140. package/dist/operators/prepend.d.ts +2 -0
  141. package/dist/operators/prepend.d.ts.map +1 -0
  142. package/dist/operators/prepend.js +8 -0
  143. package/dist/operators/prepend.js.map +1 -0
  144. package/dist/operators/select.d.ts +2 -0
  145. package/dist/operators/select.d.ts.map +1 -0
  146. package/dist/operators/select.js +10 -0
  147. package/dist/operators/select.js.map +1 -0
  148. package/dist/operators/skip.d.ts +2 -0
  149. package/dist/operators/skip.d.ts.map +1 -0
  150. package/dist/operators/skip.js +14 -0
  151. package/dist/operators/skip.js.map +1 -0
  152. package/dist/operators/sum.d.ts +2 -0
  153. package/dist/operators/sum.d.ts.map +1 -0
  154. package/dist/operators/sum.js +15 -0
  155. package/dist/operators/sum.js.map +1 -0
  156. package/dist/operators/take.d.ts +2 -0
  157. package/dist/operators/take.d.ts.map +1 -0
  158. package/dist/operators/take.js +13 -0
  159. package/dist/operators/take.js.map +1 -0
  160. package/dist/operators/toArray.d.ts +2 -0
  161. package/dist/operators/toArray.d.ts.map +1 -0
  162. package/dist/operators/toArray.js +7 -0
  163. package/dist/operators/toArray.js.map +1 -0
  164. package/dist/operators/union.d.ts +2 -0
  165. package/dist/operators/union.d.ts.map +1 -0
  166. package/dist/operators/union.js +21 -0
  167. package/dist/operators/union.js.map +1 -0
  168. package/dist/operators/where.d.ts +2 -0
  169. package/dist/operators/where.d.ts.map +1 -0
  170. package/dist/operators/where.js +12 -0
  171. package/dist/operators/where.js.map +1 -0
  172. package/dist/utils/comparers.d.ts +3 -0
  173. package/dist/utils/comparers.d.ts.map +1 -0
  174. package/dist/utils/comparers.js +21 -0
  175. package/dist/utils/comparers.js.map +1 -0
  176. package/dist/utils/guards.d.ts +7 -0
  177. package/dist/utils/guards.d.ts.map +1 -0
  178. package/dist/utils/guards.js +35 -0
  179. package/dist/utils/guards.js.map +1 -0
  180. package/package.json +2 -2
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.orderBy = orderBy;
4
+ function* orderBy(source, keySelector, comparer) {
5
+ const buffer = Array.from(source);
6
+ buffer.sort((a, b) => {
7
+ const keyA = keySelector(a);
8
+ const keyB = keySelector(b);
9
+ return comparer(keyA, keyB);
10
+ });
11
+ for (const item of buffer) {
12
+ yield item;
13
+ }
14
+ }
15
+ //# sourceMappingURL=orderBy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orderBy.js","sourceRoot":"","sources":["../../src/operators/orderBy.ts"],"names":[],"mappings":";;AAAA,0BAeC;AAfD,QAAe,CAAC,CAAC,OAAO,CACpB,MAAmB,EACnB,WAA8B,EAC9B,QAAsC;IAEtC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACjB,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAC5B,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAC5B,OAAO,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,MAAM,IAAI,CAAC;IACf,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function prepend<T>(source: Iterable<T>, element: T): Iterable<T>;
2
+ //# sourceMappingURL=prepend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepend.d.ts","sourceRoot":"","sources":["../../src/operators/prepend.ts"],"names":[],"mappings":"AAAA,wBAAiB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAGxE"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.prepend = prepend;
4
+ function* prepend(source, element) {
5
+ yield element;
6
+ yield* source;
7
+ }
8
+ //# sourceMappingURL=prepend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepend.js","sourceRoot":"","sources":["../../src/operators/prepend.ts"],"names":[],"mappings":";;AAAA,0BAGC;AAHD,QAAe,CAAC,CAAC,OAAO,CAAI,MAAmB,EAAE,OAAU;IACvD,MAAM,OAAO,CAAC;IACd,KAAK,CAAC,CAAC,MAAM,CAAC;AAClB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function select<T, U>(source: Iterable<T>, selector: (item: T, index: number) => U): Iterable<U>;
2
+ //# sourceMappingURL=select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/operators/select.ts"],"names":[],"mappings":"AAAA,wBAAiB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAKvG"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.select = select;
4
+ function* select(source, selector) {
5
+ let index = 0;
6
+ for (const item of source) {
7
+ yield selector(item, index++);
8
+ }
9
+ }
10
+ //# sourceMappingURL=select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/operators/select.ts"],"names":[],"mappings":";;AAAA,wBAKC;AALD,QAAe,CAAC,CAAC,MAAM,CAAO,MAAmB,EAAE,QAAuC;IACtF,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,MAAM,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAClC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function skip<T>(source: Iterable<T>, count: number): Iterable<T>;
2
+ //# sourceMappingURL=skip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skip.d.ts","sourceRoot":"","sources":["../../src/operators/skip.ts"],"names":[],"mappings":"AAAA,wBAAiB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CASxE"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.skip = skip;
4
+ function* skip(source, count) {
5
+ let skipped = 0;
6
+ for (const item of source) {
7
+ if (skipped < count) {
8
+ skipped++;
9
+ continue;
10
+ }
11
+ yield item;
12
+ }
13
+ }
14
+ //# sourceMappingURL=skip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skip.js","sourceRoot":"","sources":["../../src/operators/skip.ts"],"names":[],"mappings":";;AAAA,oBASC;AATD,QAAe,CAAC,CAAC,IAAI,CAAI,MAAmB,EAAE,KAAa;IACvD,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,IAAI,OAAO,GAAG,KAAK,EAAE,CAAC;YAClB,OAAO,EAAE,CAAC;YACV,SAAS;QACb,CAAC;QACD,MAAM,IAAI,CAAC;IACf,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function sum<T>(source: Iterable<T>, selector: (item: T) => number): number;
2
+ //# sourceMappingURL=sum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sum.d.ts","sourceRoot":"","sources":["../../src/operators/sum.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,CAUjF"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sum = sum;
4
+ function sum(source, selector) {
5
+ let total = 0;
6
+ for (const item of source) {
7
+ const value = selector(item);
8
+ if (typeof value !== 'number' || !Number.isFinite(value)) {
9
+ throw new TypeError('sum: value must be a finite number.');
10
+ }
11
+ total += value;
12
+ }
13
+ return total;
14
+ }
15
+ //# sourceMappingURL=sum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sum.js","sourceRoot":"","sources":["../../src/operators/sum.ts"],"names":[],"mappings":";;AAAA,kBAUC;AAVD,SAAgB,GAAG,CAAI,MAAmB,EAAE,QAA6B;IACrE,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACvD,MAAM,IAAI,SAAS,CAAC,qCAAqC,CAAC,CAAC;QAC/D,CAAC;QACD,KAAK,IAAI,KAAK,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function take<T>(source: Iterable<T>, count: number): Iterable<T>;
2
+ //# sourceMappingURL=take.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"take.d.ts","sourceRoot":"","sources":["../../src/operators/take.ts"],"names":[],"mappings":"AAAA,wBAAiB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAOxE"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.take = take;
4
+ function* take(source, count) {
5
+ let taken = 0;
6
+ for (const item of source) {
7
+ if (taken >= count)
8
+ break;
9
+ yield item;
10
+ taken++;
11
+ }
12
+ }
13
+ //# sourceMappingURL=take.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"take.js","sourceRoot":"","sources":["../../src/operators/take.ts"],"names":[],"mappings":";;AAAA,oBAOC;AAPD,QAAe,CAAC,CAAC,IAAI,CAAI,MAAmB,EAAE,KAAa;IACvD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,IAAI,KAAK,IAAI,KAAK;YAAE,MAAM;QAC1B,MAAM,IAAI,CAAC;QACX,KAAK,EAAE,CAAC;IACZ,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function toArray<T>(source: Iterable<T>): T[];
2
+ //# sourceMappingURL=toArray.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toArray.d.ts","sourceRoot":"","sources":["../../src/operators/toArray.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAEnD"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toArray = toArray;
4
+ function toArray(source) {
5
+ return Array.from(source);
6
+ }
7
+ //# sourceMappingURL=toArray.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toArray.js","sourceRoot":"","sources":["../../src/operators/toArray.ts"],"names":[],"mappings":";;AAAA,0BAEC;AAFD,SAAgB,OAAO,CAAI,MAAmB;IAC1C,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function union<T, TKey = T>(source: Iterable<T>, other: Iterable<T>, keySelector?: (item: T) => TKey): Iterable<T>;
2
+ //# sourceMappingURL=union.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../src/operators/union.ts"],"names":[],"mappings":"AAAA,wBAAiB,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,EAC9B,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EACnB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAClB,WAAW,GAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAA2B,GACtD,QAAQ,CAAC,CAAC,CAAC,CAkBb"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.union = union;
4
+ function* union(source, other, keySelector = ((x) => x)) {
5
+ const seen = new Set();
6
+ for (const item of source) {
7
+ const key = keySelector(item);
8
+ if (!seen.has(key)) {
9
+ seen.add(key);
10
+ yield item;
11
+ }
12
+ }
13
+ for (const item of other) {
14
+ const key = keySelector(item);
15
+ if (!seen.has(key)) {
16
+ seen.add(key);
17
+ yield item;
18
+ }
19
+ }
20
+ }
21
+ //# sourceMappingURL=union.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"union.js","sourceRoot":"","sources":["../../src/operators/union.ts"],"names":[],"mappings":";;AAAA,sBAsBC;AAtBD,QAAe,CAAC,CAAC,KAAK,CAClB,MAAmB,EACnB,KAAkB,EAClB,cAAiC,CAAC,CAAC,CAAI,EAAE,EAAE,CAAC,CAAC,CAAQ;IAErD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAQ,CAAC;IAE7B,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACjB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACd,MAAM,IAAI,CAAC;QACf,CAAC;IACL,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACjB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACd,MAAM,IAAI,CAAC;QACf,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function where<T>(source: Iterable<T>, predicate: (item: T, index: number) => boolean): Iterable<T>;
2
+ //# sourceMappingURL=where.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"where.d.ts","sourceRoot":"","sources":["../../src/operators/where.ts"],"names":[],"mappings":"AAAA,wBAAiB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAO1G"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.where = where;
4
+ function* where(source, predicate) {
5
+ let index = 0;
6
+ for (const item of source) {
7
+ if (predicate(item, index++)) {
8
+ yield item;
9
+ }
10
+ }
11
+ }
12
+ //# sourceMappingURL=where.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"where.js","sourceRoot":"","sources":["../../src/operators/where.ts"],"names":[],"mappings":";;AAAA,sBAOC;AAPD,QAAe,CAAC,CAAC,KAAK,CAAI,MAAmB,EAAE,SAA8C;IACzF,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,IAAI,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,CAAC;QACf,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function defaultComparer<T>(a: T, b: T): number;
2
+ export declare function identity<T>(item: T): T;
3
+ //# sourceMappingURL=comparers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comparers.d.ts","sourceRoot":"","sources":["../../src/utils/comparers.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,CAOrD;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAEtC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defaultComparer = defaultComparer;
4
+ exports.identity = identity;
5
+ function defaultComparer(a, b) {
6
+ if (a === b)
7
+ return 0;
8
+ if (a === null || a === undefined)
9
+ return -1;
10
+ if (b === null || b === undefined)
11
+ return 1;
12
+ if (a < b)
13
+ return -1;
14
+ if (a > b)
15
+ return 1;
16
+ return 0;
17
+ }
18
+ function identity(item) {
19
+ return item;
20
+ }
21
+ //# sourceMappingURL=comparers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comparers.js","sourceRoot":"","sources":["../../src/utils/comparers.ts"],"names":[],"mappings":";;AAAA,0CAOC;AAED,4BAEC;AAXD,SAAgB,eAAe,CAAI,CAAI,EAAE,CAAI;IACzC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACtB,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC,CAAC;IAC7C,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC;IAC5C,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC,CAAC;IACrB,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC;IACpB,OAAO,CAAC,CAAC;AACb,CAAC;AAED,SAAgB,QAAQ,CAAI,IAAO;IAC/B,OAAO,IAAI,CAAC;AAChB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare function isIterable<T>(obj: any): obj is Iterable<T>;
2
+ export declare function isFunction(obj: any): obj is Function;
3
+ export declare function assertIterable<T>(source: any, name?: string): asserts source is Iterable<T>;
4
+ export declare function assertFunction(fn: any, name: string): asserts fn is Function;
5
+ export declare function assertInteger(num: any, name: string): asserts num is number;
6
+ export declare function assertNonNegative(num: number, name: string): void;
7
+ //# sourceMappingURL=guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/utils/guards.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,QAAQ,CAAC,CAAC,CAAC,CAE1D;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,QAAQ,CAEpD;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,GAAE,MAAiB,GAAG,OAAO,CAAC,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,CAIrG;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,IAAI,QAAQ,CAI5E;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI,MAAM,CAI3E;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAIjE"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isIterable = isIterable;
4
+ exports.isFunction = isFunction;
5
+ exports.assertIterable = assertIterable;
6
+ exports.assertFunction = assertFunction;
7
+ exports.assertInteger = assertInteger;
8
+ exports.assertNonNegative = assertNonNegative;
9
+ function isIterable(obj) {
10
+ return obj != null && typeof obj[Symbol.iterator] === 'function';
11
+ }
12
+ function isFunction(obj) {
13
+ return typeof obj === 'function';
14
+ }
15
+ function assertIterable(source, name = 'source') {
16
+ if (!isIterable(source)) {
17
+ throw new TypeError(`${name} must be an iterable.`);
18
+ }
19
+ }
20
+ function assertFunction(fn, name) {
21
+ if (!isFunction(fn)) {
22
+ throw new TypeError(`${name} must be a function.`);
23
+ }
24
+ }
25
+ function assertInteger(num, name) {
26
+ if (typeof num !== 'number' || !Number.isFinite(num) || !Number.isInteger(num)) {
27
+ throw new TypeError(`${name} must be a finite integer.`);
28
+ }
29
+ }
30
+ function assertNonNegative(num, name) {
31
+ if (num < 0) {
32
+ throw new TypeError(`${name} must be non-negative.`);
33
+ }
34
+ }
35
+ //# sourceMappingURL=guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.js","sourceRoot":"","sources":["../../src/utils/guards.ts"],"names":[],"mappings":";;AAAA,gCAEC;AAED,gCAEC;AAED,wCAIC;AAED,wCAIC;AAED,sCAIC;AAED,8CAIC;AA9BD,SAAgB,UAAU,CAAI,GAAQ;IAClC,OAAO,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,UAAU,CAAC;AACrE,CAAC;AAED,SAAgB,UAAU,CAAC,GAAQ;IAC/B,OAAO,OAAO,GAAG,KAAK,UAAU,CAAC;AACrC,CAAC;AAED,SAAgB,cAAc,CAAI,MAAW,EAAE,OAAe,QAAQ;IAClE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,uBAAuB,CAAC,CAAC;IACxD,CAAC;AACL,CAAC;AAED,SAAgB,cAAc,CAAC,EAAO,EAAE,IAAY;IAChD,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC;QAClB,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,sBAAsB,CAAC,CAAC;IACvD,CAAC;AACL,CAAC;AAED,SAAgB,aAAa,CAAC,GAAQ,EAAE,IAAY;IAChD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7E,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,4BAA4B,CAAC,CAAC;IAC7D,CAAC;AACL,CAAC;AAED,SAAgB,iBAAiB,CAAC,GAAW,EAAE,IAAY;IACvD,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;QACV,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,wBAAwB,CAAC,CAAC;IACzD,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "inqjs",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "A lightweight, dependency-free LINQ engine for TypeScript and JavaScript with comprehensive query capabilities",
5
5
  "main": "dist/Query.js",
6
6
  "types": "dist/Query.d.ts",
7
7
  "files": [
8
- "dist/src/**/*",
8
+ "dist/**/*",
9
9
  "README.md",
10
10
  "LICENSE"
11
11
  ],