inqjs 1.0.1 → 2.0.0
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 +34 -12
- package/dist/Query.d.ts +45 -0
- package/dist/Query.d.ts.map +1 -0
- package/dist/Query.js +44 -3
- package/dist/Query.js.map +1 -0
- package/dist/async/AsyncQuery.d.ts +41 -0
- package/dist/async/AsyncQuery.d.ts.map +1 -0
- package/dist/async/AsyncQuery.js +181 -0
- package/dist/async/AsyncQuery.js.map +1 -0
- package/dist/async/operators/allAsync.d.ts +2 -0
- package/dist/async/operators/allAsync.d.ts.map +1 -0
- package/dist/async/operators/allAsync.js +12 -0
- package/dist/async/operators/allAsync.js.map +1 -0
- package/dist/async/operators/anyAsync.d.ts +2 -0
- package/dist/async/operators/anyAsync.d.ts.map +1 -0
- package/dist/async/operators/anyAsync.js +18 -0
- package/dist/async/operators/anyAsync.js.map +1 -0
- package/dist/async/operators/appendAsync.d.ts +2 -0
- package/dist/async/operators/appendAsync.d.ts.map +1 -0
- package/dist/async/operators/appendAsync.js +8 -0
- package/dist/async/operators/appendAsync.js.map +1 -0
- package/dist/async/operators/concatAsync.d.ts +2 -0
- package/dist/async/operators/concatAsync.d.ts.map +1 -0
- package/dist/async/operators/concatAsync.js +8 -0
- package/dist/async/operators/concatAsync.js.map +1 -0
- package/dist/async/operators/countAsync.d.ts +2 -0
- package/dist/async/operators/countAsync.d.ts.map +1 -0
- package/dist/async/operators/countAsync.js +13 -0
- package/dist/async/operators/countAsync.js.map +1 -0
- package/dist/async/operators/distinctAsync.d.ts +2 -0
- package/dist/async/operators/distinctAsync.d.ts.map +1 -0
- package/dist/async/operators/distinctAsync.js +14 -0
- package/dist/async/operators/distinctAsync.js.map +1 -0
- package/dist/async/operators/exceptAsync.d.ts +2 -0
- package/dist/async/operators/exceptAsync.d.ts.map +1 -0
- package/dist/async/operators/exceptAsync.js +18 -0
- package/dist/async/operators/exceptAsync.js.map +1 -0
- package/dist/async/operators/firstAsync.d.ts +2 -0
- package/dist/async/operators/firstAsync.d.ts.map +1 -0
- package/dist/async/operators/firstAsync.js +21 -0
- package/dist/async/operators/firstAsync.js.map +1 -0
- package/dist/async/operators/groupByAsync.d.ts +3 -0
- package/dist/async/operators/groupByAsync.d.ts.map +1 -0
- package/dist/async/operators/groupByAsync.js +22 -0
- package/dist/async/operators/groupByAsync.js.map +1 -0
- package/dist/async/operators/intersectAsync.d.ts +2 -0
- package/dist/async/operators/intersectAsync.d.ts.map +1 -0
- package/dist/async/operators/intersectAsync.js +18 -0
- package/dist/async/operators/intersectAsync.js.map +1 -0
- package/dist/async/operators/joinAsync.d.ts +2 -0
- package/dist/async/operators/joinAsync.d.ts.map +1 -0
- package/dist/async/operators/joinAsync.js +25 -0
- package/dist/async/operators/joinAsync.js.map +1 -0
- package/dist/async/operators/maxAsync.d.ts +2 -0
- package/dist/async/operators/maxAsync.d.ts.map +1 -0
- package/dist/async/operators/maxAsync.js +17 -0
- package/dist/async/operators/maxAsync.js.map +1 -0
- package/dist/async/operators/minAsync.d.ts +2 -0
- package/dist/async/operators/minAsync.d.ts.map +1 -0
- package/dist/async/operators/minAsync.js +17 -0
- package/dist/async/operators/minAsync.js.map +1 -0
- package/dist/async/operators/orderByAsync.d.ts +2 -0
- package/dist/async/operators/orderByAsync.d.ts.map +1 -0
- package/dist/async/operators/orderByAsync.js +19 -0
- package/dist/async/operators/orderByAsync.js.map +1 -0
- package/dist/async/operators/orderByManyAsync.d.ts +6 -0
- package/dist/async/operators/orderByManyAsync.d.ts.map +1 -0
- package/dist/async/operators/orderByManyAsync.js +25 -0
- package/dist/async/operators/orderByManyAsync.js.map +1 -0
- package/dist/async/operators/prependAsync.d.ts +2 -0
- package/dist/async/operators/prependAsync.d.ts.map +1 -0
- package/dist/async/operators/prependAsync.js +8 -0
- package/dist/async/operators/prependAsync.js.map +1 -0
- package/dist/async/operators/selectAsync.d.ts +2 -0
- package/dist/async/operators/selectAsync.d.ts.map +1 -0
- package/dist/async/operators/selectAsync.js +10 -0
- package/dist/async/operators/selectAsync.js.map +1 -0
- package/dist/async/operators/selectManyAsync.d.ts +2 -0
- package/dist/async/operators/selectManyAsync.d.ts.map +1 -0
- package/dist/async/operators/selectManyAsync.js +13 -0
- package/dist/async/operators/selectManyAsync.js.map +1 -0
- package/dist/async/operators/skipAsync.d.ts +2 -0
- package/dist/async/operators/skipAsync.d.ts.map +1 -0
- package/dist/async/operators/skipAsync.js +14 -0
- package/dist/async/operators/skipAsync.js.map +1 -0
- package/dist/async/operators/sumAsync.d.ts +2 -0
- package/dist/async/operators/sumAsync.d.ts.map +1 -0
- package/dist/async/operators/sumAsync.js +15 -0
- package/dist/async/operators/sumAsync.js.map +1 -0
- package/dist/async/operators/takeAsync.d.ts +2 -0
- package/dist/async/operators/takeAsync.d.ts.map +1 -0
- package/dist/async/operators/takeAsync.js +13 -0
- package/dist/async/operators/takeAsync.js.map +1 -0
- package/dist/async/operators/toArrayAsync.d.ts +2 -0
- package/dist/async/operators/toArrayAsync.d.ts.map +1 -0
- package/dist/async/operators/toArrayAsync.js +11 -0
- package/dist/async/operators/toArrayAsync.js.map +1 -0
- package/dist/async/operators/unionAsync.d.ts +2 -0
- package/dist/async/operators/unionAsync.d.ts.map +1 -0
- package/dist/async/operators/unionAsync.js +21 -0
- package/dist/async/operators/unionAsync.js.map +1 -0
- package/dist/async/operators/whereAsync.d.ts +2 -0
- package/dist/async/operators/whereAsync.d.ts.map +1 -0
- package/dist/async/operators/whereAsync.js +12 -0
- package/dist/async/operators/whereAsync.js.map +1 -0
- package/dist/json/fromJson.d.ts +20 -0
- package/dist/json/fromJson.d.ts.map +1 -0
- package/dist/json/fromJson.js +49 -0
- package/dist/json/fromJson.js.map +1 -0
- package/dist/operators/all.d.ts +2 -0
- package/dist/operators/all.d.ts.map +1 -0
- package/dist/operators/all.js +12 -0
- package/dist/operators/all.js.map +1 -0
- package/dist/operators/any.d.ts +2 -0
- package/dist/operators/any.d.ts.map +1 -0
- package/dist/operators/any.js +17 -0
- package/dist/operators/any.js.map +1 -0
- package/dist/operators/append.d.ts +2 -0
- package/dist/operators/append.d.ts.map +1 -0
- package/dist/operators/append.js +8 -0
- package/dist/operators/append.js.map +1 -0
- package/dist/operators/concat.d.ts +2 -0
- package/dist/operators/concat.d.ts.map +1 -0
- package/dist/operators/concat.js +8 -0
- package/dist/operators/concat.js.map +1 -0
- package/dist/operators/count.d.ts +2 -0
- package/dist/operators/count.d.ts.map +1 -0
- package/dist/operators/count.js +13 -0
- package/dist/operators/count.js.map +1 -0
- package/dist/operators/distinct.d.ts +2 -0
- package/dist/operators/distinct.d.ts.map +1 -0
- package/dist/operators/distinct.js +14 -0
- package/dist/operators/distinct.js.map +1 -0
- package/dist/operators/except.d.ts +2 -0
- package/dist/operators/except.d.ts.map +1 -0
- package/dist/operators/except.js +18 -0
- package/dist/operators/except.js.map +1 -0
- package/dist/operators/first.d.ts +2 -0
- package/dist/operators/first.d.ts.map +1 -0
- package/dist/operators/first.js +21 -0
- package/dist/operators/first.js.map +1 -0
- package/dist/operators/groupBy.d.ts +8 -0
- package/dist/operators/groupBy.d.ts.map +1 -0
- package/dist/operators/groupBy.js +31 -0
- package/dist/operators/groupBy.js.map +1 -0
- package/dist/operators/intersect.d.ts +2 -0
- package/dist/operators/intersect.d.ts.map +1 -0
- package/dist/operators/intersect.js +18 -0
- package/dist/operators/intersect.js.map +1 -0
- package/dist/operators/join.d.ts +2 -0
- package/dist/operators/join.d.ts.map +1 -0
- package/dist/operators/join.js +25 -0
- package/dist/operators/join.js.map +1 -0
- package/dist/operators/max.d.ts +2 -0
- package/dist/operators/max.d.ts.map +1 -0
- package/dist/operators/max.js +17 -0
- package/dist/operators/max.js.map +1 -0
- package/dist/operators/min.d.ts +2 -0
- package/dist/operators/min.d.ts.map +1 -0
- package/dist/operators/min.js +17 -0
- package/dist/operators/min.js.map +1 -0
- package/dist/operators/orderBy.d.ts +2 -0
- package/dist/operators/orderBy.d.ts.map +1 -0
- package/dist/operators/orderBy.js +15 -0
- package/dist/operators/orderBy.js.map +1 -0
- package/dist/operators/orderByMany.d.ts +6 -0
- package/dist/operators/orderByMany.d.ts.map +1 -0
- package/dist/operators/orderByMany.js +18 -0
- package/dist/operators/orderByMany.js.map +1 -0
- package/dist/operators/prepend.d.ts +2 -0
- package/dist/operators/prepend.d.ts.map +1 -0
- package/dist/operators/prepend.js +8 -0
- package/dist/operators/prepend.js.map +1 -0
- package/dist/operators/select.d.ts +2 -0
- package/dist/operators/select.d.ts.map +1 -0
- package/dist/operators/select.js +10 -0
- package/dist/operators/select.js.map +1 -0
- package/dist/operators/selectMany.d.ts +2 -0
- package/dist/operators/selectMany.d.ts.map +1 -0
- package/dist/operators/selectMany.js +12 -0
- package/dist/operators/selectMany.js.map +1 -0
- package/dist/operators/skip.d.ts +2 -0
- package/dist/operators/skip.d.ts.map +1 -0
- package/dist/operators/skip.js +14 -0
- package/dist/operators/skip.js.map +1 -0
- package/dist/operators/sum.d.ts +2 -0
- package/dist/operators/sum.d.ts.map +1 -0
- package/dist/operators/sum.js +15 -0
- package/dist/operators/sum.js.map +1 -0
- package/dist/operators/take.d.ts +2 -0
- package/dist/operators/take.d.ts.map +1 -0
- package/dist/operators/take.js +13 -0
- package/dist/operators/take.js.map +1 -0
- package/dist/operators/toArray.d.ts +2 -0
- package/dist/operators/toArray.d.ts.map +1 -0
- package/dist/operators/toArray.js +7 -0
- package/dist/operators/toArray.js.map +1 -0
- package/dist/operators/union.d.ts +2 -0
- package/dist/operators/union.d.ts.map +1 -0
- package/dist/operators/union.js +21 -0
- package/dist/operators/union.js.map +1 -0
- package/dist/operators/where.d.ts +2 -0
- package/dist/operators/where.d.ts.map +1 -0
- package/dist/operators/where.js +12 -0
- package/dist/operators/where.js.map +1 -0
- package/dist/utils/comparers.d.ts +3 -0
- package/dist/utils/comparers.d.ts.map +1 -0
- package/dist/utils/comparers.js +21 -0
- package/dist/utils/comparers.js.map +1 -0
- package/dist/utils/guards.d.ts +10 -0
- package/dist/utils/guards.d.ts.map +1 -0
- package/dist/utils/guards.js +49 -0
- package/dist/utils/guards.js.map +1 -0
- package/package.json +24 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whereAsync.js","sourceRoot":"","sources":["../../../src/async/operators/whereAsync.ts"],"names":[],"mappings":";;AAAA,gCAUC;AAVM,KAAK,SAAS,CAAC,CAAC,UAAU,CAC7B,MAAwB,EACxB,SAAiE;IAEjE,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC9B,IAAI,MAAM,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,CAAC;QACf,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Query } from '../Query';
|
|
2
|
+
/**
|
|
3
|
+
* Parse a JSON string and return a Query over the result.
|
|
4
|
+
* - If the JSON is an array, returns a Query over the array elements.
|
|
5
|
+
* - If the JSON is an object, returns a Query over the object's entries as [key, value] tuples.
|
|
6
|
+
* - For primitive values, wraps them in a single-element array.
|
|
7
|
+
*/
|
|
8
|
+
export declare function fromJson<T = any>(jsonString: string): Query<T>;
|
|
9
|
+
/**
|
|
10
|
+
* Parse a JSON string as an array and return a Query over its elements.
|
|
11
|
+
* Throws if the JSON is not an array.
|
|
12
|
+
*/
|
|
13
|
+
export declare function fromJsonArray<T = any>(jsonString: string): Query<T>;
|
|
14
|
+
/**
|
|
15
|
+
* Parse a JSON string as an object and return a Query over its entries.
|
|
16
|
+
* Each entry is a [key, value] tuple.
|
|
17
|
+
* Throws if the JSON is not an object.
|
|
18
|
+
*/
|
|
19
|
+
export declare function fromJsonObject<T = any>(jsonString: string): Query<[string, T]>;
|
|
20
|
+
//# sourceMappingURL=fromJson.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromJson.d.ts","sourceRoot":"","sources":["../../src/json/fromJson.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAW9D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAQnE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,GAAG,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAQ9E"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fromJson = fromJson;
|
|
4
|
+
exports.fromJsonArray = fromJsonArray;
|
|
5
|
+
exports.fromJsonObject = fromJsonObject;
|
|
6
|
+
const Query_1 = require("../Query");
|
|
7
|
+
/**
|
|
8
|
+
* Parse a JSON string and return a Query over the result.
|
|
9
|
+
* - If the JSON is an array, returns a Query over the array elements.
|
|
10
|
+
* - If the JSON is an object, returns a Query over the object's entries as [key, value] tuples.
|
|
11
|
+
* - For primitive values, wraps them in a single-element array.
|
|
12
|
+
*/
|
|
13
|
+
function fromJson(jsonString) {
|
|
14
|
+
const parsed = JSON.parse(jsonString);
|
|
15
|
+
if (Array.isArray(parsed)) {
|
|
16
|
+
return Query_1.Query.from(parsed);
|
|
17
|
+
}
|
|
18
|
+
else if (parsed !== null && typeof parsed === 'object') {
|
|
19
|
+
return Query_1.Query.from(Object.entries(parsed));
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
// Primitive value - wrap in array
|
|
23
|
+
return Query_1.Query.from([parsed]);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parse a JSON string as an array and return a Query over its elements.
|
|
28
|
+
* Throws if the JSON is not an array.
|
|
29
|
+
*/
|
|
30
|
+
function fromJsonArray(jsonString) {
|
|
31
|
+
const parsed = JSON.parse(jsonString);
|
|
32
|
+
if (!Array.isArray(parsed)) {
|
|
33
|
+
throw new TypeError('JSON value is not an array');
|
|
34
|
+
}
|
|
35
|
+
return Query_1.Query.from(parsed);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Parse a JSON string as an object and return a Query over its entries.
|
|
39
|
+
* Each entry is a [key, value] tuple.
|
|
40
|
+
* Throws if the JSON is not an object.
|
|
41
|
+
*/
|
|
42
|
+
function fromJsonObject(jsonString) {
|
|
43
|
+
const parsed = JSON.parse(jsonString);
|
|
44
|
+
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
45
|
+
throw new TypeError('JSON value is not an object');
|
|
46
|
+
}
|
|
47
|
+
return Query_1.Query.from(Object.entries(parsed));
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=fromJson.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromJson.js","sourceRoot":"","sources":["../../src/json/fromJson.ts"],"names":[],"mappings":";;AAQA,4BAWC;AAMD,sCAQC;AAOD,wCAQC;AAhDD,oCAAiC;AAEjC;;;;;GAKG;AACH,SAAgB,QAAQ,CAAU,UAAkB;IAChD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAEtC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,OAAO,aAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;SAAM,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QACvD,OAAO,aAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAwB,CAAC;IACrE,CAAC;SAAM,CAAC;QACJ,kCAAkC;QAClC,OAAO,aAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAChC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAU,UAAkB;IACrD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAEtC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,4BAA4B,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,aAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,SAAgB,cAAc,CAAU,UAAkB;IACtD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAEtC,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACzE,MAAM,IAAI,SAAS,CAAC,6BAA6B,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,aAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../../src/operators/all.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,CAOpF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.all = all;
|
|
4
|
+
function all(source, predicate) {
|
|
5
|
+
for (const item of source) {
|
|
6
|
+
if (!predicate(item)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=all.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all.js","sourceRoot":"","sources":["../../src/operators/all.ts"],"names":[],"mappings":";;AAAA,kBAOC;AAPD,SAAgB,GAAG,CAAI,MAAmB,EAAE,SAA+B;IACvE,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;YACnB,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"any.d.ts","sourceRoot":"","sources":["../../src/operators/any.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,CAarF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.any = any;
|
|
4
|
+
function any(source, predicate) {
|
|
5
|
+
if (predicate) {
|
|
6
|
+
for (const item of source) {
|
|
7
|
+
if (predicate(item)) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
// If no predicate, check if source has any elements
|
|
14
|
+
const iterator = source[Symbol.iterator]();
|
|
15
|
+
return !iterator.next().done;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=any.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"any.js","sourceRoot":"","sources":["../../src/operators/any.ts"],"names":[],"mappings":";;AAAA,kBAaC;AAbD,SAAgB,GAAG,CAAI,MAAmB,EAAE,SAAgC;IACxE,IAAI,SAAS,EAAE,CAAC;QACZ,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;YACxB,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;gBAClB,OAAO,IAAI,CAAC;YAChB,CAAC;QACL,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,oDAAoD;IACpD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC3C,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"append.d.ts","sourceRoot":"","sources":["../../src/operators/append.ts"],"names":[],"mappings":"AAAA,wBAAiB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAGvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"append.js","sourceRoot":"","sources":["../../src/operators/append.ts"],"names":[],"mappings":";;AAAA,wBAGC;AAHD,QAAe,CAAC,CAAC,MAAM,CAAI,MAAmB,EAAE,OAAU;IACtD,KAAK,CAAC,CAAC,MAAM,CAAC;IACd,MAAM,OAAO,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concat.d.ts","sourceRoot":"","sources":["../../src/operators/concat.ts"],"names":[],"mappings":"AAAA,wBAAiB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAG/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concat.js","sourceRoot":"","sources":["../../src/operators/concat.ts"],"names":[],"mappings":";;AAAA,wBAGC;AAHD,QAAe,CAAC,CAAC,MAAM,CAAI,MAAmB,EAAE,KAAkB;IAC9D,KAAK,CAAC,CAAC,MAAM,CAAC;IACd,KAAK,CAAC,CAAC,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../../src/operators/count.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GAAG,MAAM,CAQtF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.count = count;
|
|
4
|
+
function count(source, predicate) {
|
|
5
|
+
let count = 0;
|
|
6
|
+
for (const item of source) {
|
|
7
|
+
if (!predicate || predicate(item)) {
|
|
8
|
+
count++;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return count;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=count.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"count.js","sourceRoot":"","sources":["../../src/operators/count.ts"],"names":[],"mappings":";;AAAA,sBAQC;AARD,SAAgB,KAAK,CAAI,MAAmB,EAAE,SAAgC;IAC1E,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,KAAK,EAAE,CAAC;QACZ,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distinct.d.ts","sourceRoot":"","sources":["../../src/operators/distinct.ts"],"names":[],"mappings":"AAAA,wBAAiB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CASnG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.distinct = distinct;
|
|
4
|
+
function* distinct(source, keySelector) {
|
|
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
|
+
}
|
|
14
|
+
//# sourceMappingURL=distinct.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distinct.js","sourceRoot":"","sources":["../../src/operators/distinct.ts"],"names":[],"mappings":";;AAAA,4BASC;AATD,QAAe,CAAC,CAAC,QAAQ,CAAU,MAAmB,EAAE,WAA8B;IAClF,MAAM,IAAI,GAAG,IAAI,GAAG,EAAQ,CAAC;IAC7B,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;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"except.d.ts","sourceRoot":"","sources":["../../src/operators/except.ts"],"names":[],"mappings":"AAAA,wBAAiB,MAAM,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,EAC/B,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,CAcb"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.except = except;
|
|
4
|
+
function* except(source, other, keySelector = ((x) => x)) {
|
|
5
|
+
const otherKeys = new Set();
|
|
6
|
+
for (const item of other) {
|
|
7
|
+
otherKeys.add(keySelector(item));
|
|
8
|
+
}
|
|
9
|
+
const seen = new Set();
|
|
10
|
+
for (const item of source) {
|
|
11
|
+
const key = keySelector(item);
|
|
12
|
+
if (!otherKeys.has(key) && !seen.has(key)) {
|
|
13
|
+
seen.add(key);
|
|
14
|
+
yield item;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=except.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"except.js","sourceRoot":"","sources":["../../src/operators/except.ts"],"names":[],"mappings":";;AAAA,wBAkBC;AAlBD,QAAe,CAAC,CAAC,MAAM,CACnB,MAAmB,EACnB,KAAkB,EAClB,cAAiC,CAAC,CAAC,CAAI,EAAE,EAAE,CAAC,CAAC,CAAQ;IAErD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAQ,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,GAAG,EAAQ,CAAC;IAC7B,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACxC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACd,MAAM,IAAI,CAAC;QACf,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"first.d.ts","sourceRoot":"","sources":["../../src/operators/first.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GAAG,CAAC,CAejF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.first = first;
|
|
4
|
+
function first(source, predicate) {
|
|
5
|
+
if (predicate) {
|
|
6
|
+
for (const item of source) {
|
|
7
|
+
if (predicate(item)) {
|
|
8
|
+
return item;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
const iterator = source[Symbol.iterator]();
|
|
14
|
+
const result = iterator.next();
|
|
15
|
+
if (!result.done) {
|
|
16
|
+
return result.value;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
throw new Error('Sequence contains no matching element.');
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=first.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"first.js","sourceRoot":"","sources":["../../src/operators/first.ts"],"names":[],"mappings":";;AAAA,sBAeC;AAfD,SAAgB,KAAK,CAAI,MAAmB,EAAE,SAAgC;IAC1E,IAAI,SAAS,EAAE,CAAC;QACZ,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;YACxB,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;gBAClB,OAAO,IAAI,CAAC;YAChB,CAAC;QACL,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3C,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,MAAM,CAAC,KAAK,CAAC;QACxB,CAAC;IACL,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class Grouping<TKey, TElement> implements Iterable<TElement> {
|
|
2
|
+
readonly key: TKey;
|
|
3
|
+
readonly values: TElement[];
|
|
4
|
+
constructor(key: TKey, values: TElement[]);
|
|
5
|
+
[Symbol.iterator](): Iterator<TElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare function groupBy<T, TKey, TElement = T>(source: Iterable<T>, keySelector: (item: T) => TKey, elementSelector?: (item: T) => TElement): Iterable<Grouping<TKey, TElement>>;
|
|
8
|
+
//# sourceMappingURL=groupBy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupBy.d.ts","sourceRoot":"","sources":["../../src/operators/groupBy.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAE,YAAW,QAAQ,CAAC,QAAQ,CAAC;aAE3C,GAAG,EAAE,IAAI;aACT,MAAM,EAAE,QAAQ,EAAE;gBADlB,GAAG,EAAE,IAAI,EACT,MAAM,EAAE,QAAQ,EAAE;IAG/B,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC;CAGjD;AAED,wBAAiB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,GAAG,CAAC,EAC1C,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EACnB,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,EAC9B,eAAe,GAAE,CAAC,IAAI,EAAE,CAAC,KAAK,QAAqD,GACpF,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAgBpC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Grouping = void 0;
|
|
4
|
+
exports.groupBy = groupBy;
|
|
5
|
+
class Grouping {
|
|
6
|
+
constructor(key, values) {
|
|
7
|
+
this.key = key;
|
|
8
|
+
this.values = values;
|
|
9
|
+
}
|
|
10
|
+
[Symbol.iterator]() {
|
|
11
|
+
return this.values[Symbol.iterator]();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.Grouping = Grouping;
|
|
15
|
+
function* groupBy(source, keySelector, elementSelector = ((item) => item)) {
|
|
16
|
+
const groups = new Map();
|
|
17
|
+
for (const item of source) {
|
|
18
|
+
const key = keySelector(item);
|
|
19
|
+
const group = groups.get(key);
|
|
20
|
+
if (group) {
|
|
21
|
+
group.push(elementSelector(item));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
groups.set(key, [elementSelector(item)]);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
for (const [key, values] of groups) {
|
|
28
|
+
yield new Grouping(key, values);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=groupBy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupBy.js","sourceRoot":"","sources":["../../src/operators/groupBy.ts"],"names":[],"mappings":";;;AAWA,0BAoBC;AA/BD,MAAa,QAAQ;IACjB,YACoB,GAAS,EACT,MAAkB;QADlB,QAAG,GAAH,GAAG,CAAM;QACT,WAAM,GAAN,MAAM,CAAY;IACnC,CAAC;IAEG,CAAC,MAAM,CAAC,QAAQ,CAAC;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC1C,CAAC;CACJ;AATD,4BASC;AAED,QAAe,CAAC,CAAC,OAAO,CACpB,MAAmB,EACnB,WAA8B,EAC9B,kBAAyC,CAAC,CAAC,IAAO,EAAE,EAAE,CAAC,IAA2B,CAAC;IAEnF,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAC;IAE3C,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,KAAK,EAAE,CAAC;YACR,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;QACtC,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7C,CAAC;IACL,CAAC;IAED,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACjC,MAAM,IAAI,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intersect.d.ts","sourceRoot":"","sources":["../../src/operators/intersect.ts"],"names":[],"mappings":"AAAA,wBAAiB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,EAClC,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,CAcb"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.intersect = intersect;
|
|
4
|
+
function* intersect(source, other, keySelector = ((x) => x)) {
|
|
5
|
+
const otherKeys = new Set();
|
|
6
|
+
for (const item of other) {
|
|
7
|
+
otherKeys.add(keySelector(item));
|
|
8
|
+
}
|
|
9
|
+
const seen = new Set();
|
|
10
|
+
for (const item of source) {
|
|
11
|
+
const key = keySelector(item);
|
|
12
|
+
if (otherKeys.has(key) && !seen.has(key)) {
|
|
13
|
+
seen.add(key);
|
|
14
|
+
yield item;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=intersect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intersect.js","sourceRoot":"","sources":["../../src/operators/intersect.ts"],"names":[],"mappings":";;AAAA,8BAkBC;AAlBD,QAAe,CAAC,CAAC,SAAS,CACtB,MAAmB,EACnB,KAAkB,EAClB,cAAiC,CAAC,CAAC,CAAI,EAAE,EAAE,CAAC,CAAC,CAAQ;IAErD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAQ,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,GAAG,EAAQ,CAAC;IAC7B,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACvC,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 join<TOuter, TInner, TKey, TResult>(outer: Iterable<TOuter>, inner: Iterable<TInner>, outerKeySelector: (item: TOuter) => TKey, innerKeySelector: (item: TInner) => TKey, resultSelector: (outer: TOuter, inner: TInner) => TResult): Iterable<TResult>;
|
|
2
|
+
//# sourceMappingURL=join.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"join.d.ts","sourceRoot":"","sources":["../../src/operators/join.ts"],"names":[],"mappings":"AAAA,wBAAiB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAC/C,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EACvB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EACvB,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EACxC,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EACxC,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,GAC1D,QAAQ,CAAC,OAAO,CAAC,CAoBnB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.join = join;
|
|
4
|
+
function* join(outer, inner, outerKeySelector, innerKeySelector, resultSelector) {
|
|
5
|
+
const lookup = new Map();
|
|
6
|
+
for (const innerItem of inner) {
|
|
7
|
+
const key = innerKeySelector(innerItem);
|
|
8
|
+
const group = lookup.get(key);
|
|
9
|
+
if (group) {
|
|
10
|
+
group.push(innerItem);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
lookup.set(key, [innerItem]);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
for (const outerItem of outer) {
|
|
17
|
+
const matches = lookup.get(outerKeySelector(outerItem));
|
|
18
|
+
if (!matches)
|
|
19
|
+
continue;
|
|
20
|
+
for (const innerItem of matches) {
|
|
21
|
+
yield resultSelector(outerItem, innerItem);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=join.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"join.js","sourceRoot":"","sources":["../../src/operators/join.ts"],"names":[],"mappings":";;AAAA,oBA0BC;AA1BD,QAAe,CAAC,CAAC,IAAI,CACjB,KAAuB,EACvB,KAAuB,EACvB,gBAAwC,EACxC,gBAAwC,EACxC,cAAyD;IAEzD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEzC,KAAK,MAAM,SAAS,IAAI,KAAK,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACxC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,KAAK,EAAE,CAAC;YACR,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;QACjC,CAAC;IACL,CAAC;IAED,KAAK,MAAM,SAAS,IAAI,KAAK,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC,OAAO;YAAE,SAAS;QACvB,KAAK,MAAM,SAAS,IAAI,OAAO,EAAE,CAAC;YAC9B,MAAM,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"max.d.ts","sourceRoot":"","sources":["../../src/operators/max.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,GAAG,SAAS,CAY7F"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.max = max;
|
|
4
|
+
function max(source, selector) {
|
|
5
|
+
let maxValue;
|
|
6
|
+
for (const item of source) {
|
|
7
|
+
const value = selector(item);
|
|
8
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
9
|
+
throw new TypeError('max: value must be a finite number.');
|
|
10
|
+
}
|
|
11
|
+
if (maxValue === undefined || value > maxValue) {
|
|
12
|
+
maxValue = value;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return maxValue;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=max.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"max.js","sourceRoot":"","sources":["../../src/operators/max.ts"],"names":[],"mappings":";;AAAA,kBAYC;AAZD,SAAgB,GAAG,CAAI,MAAmB,EAAE,QAA6B;IACrE,IAAI,QAA4B,CAAC;IACjC,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,IAAI,QAAQ,KAAK,SAAS,IAAI,KAAK,GAAG,QAAQ,EAAE,CAAC;YAC7C,QAAQ,GAAG,KAAK,CAAC;QACrB,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"min.d.ts","sourceRoot":"","sources":["../../src/operators/min.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,GAAG,SAAS,CAY7F"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.min = min;
|
|
4
|
+
function min(source, selector) {
|
|
5
|
+
let minValue;
|
|
6
|
+
for (const item of source) {
|
|
7
|
+
const value = selector(item);
|
|
8
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
9
|
+
throw new TypeError('min: value must be a finite number.');
|
|
10
|
+
}
|
|
11
|
+
if (minValue === undefined || value < minValue) {
|
|
12
|
+
minValue = value;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return minValue;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"min.js","sourceRoot":"","sources":["../../src/operators/min.ts"],"names":[],"mappings":";;AAAA,kBAYC;AAZD,SAAgB,GAAG,CAAI,MAAmB,EAAE,QAA6B;IACrE,IAAI,QAA4B,CAAC;IACjC,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,IAAI,QAAQ,KAAK,SAAS,IAAI,KAAK,GAAG,QAAQ,EAAE,CAAC;YAC7C,QAAQ,GAAG,KAAK,CAAC;QACrB,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orderBy.d.ts","sourceRoot":"","sources":["../../src/operators/orderBy.ts"],"names":[],"mappings":"AAAA,wBAAiB,OAAO,CAAC,CAAC,EAAE,IAAI,EAC5B,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EACnB,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,EAC9B,QAAQ,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,KAAK,MAAM,GACvC,QAAQ,CAAC,CAAC,CAAC,CAWb"}
|
|
@@ -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,6 @@
|
|
|
1
|
+
export interface SortCriterion<T, TKey = any> {
|
|
2
|
+
keySelector: (item: T) => TKey;
|
|
3
|
+
comparer: (a: TKey, b: TKey) => number;
|
|
4
|
+
}
|
|
5
|
+
export declare function orderByMany<T>(source: Iterable<T>, criteria: ReadonlyArray<SortCriterion<T>>): Iterable<T>;
|
|
6
|
+
//# sourceMappingURL=orderByMany.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orderByMany.d.ts","sourceRoot":"","sources":["../../src/operators/orderByMany.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa,CAAC,CAAC,EAAE,IAAI,GAAG,GAAG;IACxC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,KAAK,MAAM,CAAC;CAC1C;AAED,wBAAiB,WAAW,CAAC,CAAC,EAC1B,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EACnB,QAAQ,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAC1C,QAAQ,CAAC,CAAC,CAAC,CAab"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.orderByMany = orderByMany;
|
|
4
|
+
function* orderByMany(source, criteria) {
|
|
5
|
+
const buffer = Array.from(source);
|
|
6
|
+
buffer.sort((a, b) => {
|
|
7
|
+
for (const criterion of criteria) {
|
|
8
|
+
const comparison = criterion.comparer(criterion.keySelector(a), criterion.keySelector(b));
|
|
9
|
+
if (comparison !== 0)
|
|
10
|
+
return comparison;
|
|
11
|
+
}
|
|
12
|
+
return 0;
|
|
13
|
+
});
|
|
14
|
+
for (const item of buffer) {
|
|
15
|
+
yield item;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=orderByMany.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orderByMany.js","sourceRoot":"","sources":["../../src/operators/orderByMany.ts"],"names":[],"mappings":";;AAKA,kCAgBC;AAhBD,QAAe,CAAC,CAAC,WAAW,CACxB,MAAmB,EACnB,QAAyC;IAEzC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACjB,KAAK,MAAM,SAAS,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1F,IAAI,UAAU,KAAK,CAAC;gBAAE,OAAO,UAAU,CAAC;QAC5C,CAAC;QACD,OAAO,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;IAEH,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QACxB,MAAM,IAAI,CAAC;IACf,CAAC;AACL,CAAC"}
|
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"selectMany.d.ts","sourceRoot":"","sources":["../../src/operators/selectMany.ts"],"names":[],"mappings":"AAAA,wBAAiB,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EACnC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EACnB,kBAAkB,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAC3D,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,KAAK,CAAC,GACnD,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAOjB"}
|