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.
- package/dist/Query.d.ts +31 -0
- package/dist/Query.d.ts.map +1 -0
- package/dist/Query.js.map +1 -0
- package/dist/async/AsyncQuery.d.ts +28 -0
- package/dist/async/AsyncQuery.d.ts.map +1 -0
- package/dist/async/AsyncQuery.js +138 -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/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/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/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/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/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/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/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/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 +7 -0
- package/dist/utils/guards.d.ts.map +1 -0
- package/dist/utils/guards.js +35 -0
- package/dist/utils/guards.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectAsync.d.ts","sourceRoot":"","sources":["../../../src/async/operators/selectAsync.ts"],"names":[],"mappings":"AAAA,wBAAuB,WAAW,CAAC,CAAC,EAAE,CAAC,EACnC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EACxB,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GACrD,aAAa,CAAC,CAAC,CAAC,CAKlB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.selectAsync = selectAsync;
|
|
4
|
+
async function* selectAsync(source, selector) {
|
|
5
|
+
let index = 0;
|
|
6
|
+
for await (const item of source) {
|
|
7
|
+
yield await selector(item, index++);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=selectAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectAsync.js","sourceRoot":"","sources":["../../../src/async/operators/selectAsync.ts"],"names":[],"mappings":";;AAAA,kCAQC;AARM,KAAK,SAAS,CAAC,CAAC,WAAW,CAC9B,MAAwB,EACxB,QAAoD;IAEpD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC9B,MAAM,MAAM,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACxC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skipAsync.d.ts","sourceRoot":"","sources":["../../../src/async/operators/skipAsync.ts"],"names":[],"mappings":"AAAA,wBAAuB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAS7F"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.skipAsync = skipAsync;
|
|
4
|
+
async function* skipAsync(source, count) {
|
|
5
|
+
let skipped = 0;
|
|
6
|
+
for await (const item of source) {
|
|
7
|
+
if (skipped < count) {
|
|
8
|
+
skipped++;
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
yield item;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=skipAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skipAsync.js","sourceRoot":"","sources":["../../../src/async/operators/skipAsync.ts"],"names":[],"mappings":";;AAAA,8BASC;AATM,KAAK,SAAS,CAAC,CAAC,SAAS,CAAI,MAAwB,EAAE,KAAa;IACvE,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC9B,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 @@
|
|
|
1
|
+
{"version":3,"file":"sumAsync.d.ts","sourceRoot":"","sources":["../../../src/async/operators/sumAsync.ts"],"names":[],"mappings":"AAAA,wBAAsB,QAAQ,CAAC,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EACxB,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAChD,OAAO,CAAC,MAAM,CAAC,CAUjB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sumAsync = sumAsync;
|
|
4
|
+
async function sumAsync(source, selector) {
|
|
5
|
+
let total = 0;
|
|
6
|
+
for await (const item of source) {
|
|
7
|
+
const value = await selector(item);
|
|
8
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
9
|
+
throw new TypeError('sumAsync: value must be a finite number.');
|
|
10
|
+
}
|
|
11
|
+
total += value;
|
|
12
|
+
}
|
|
13
|
+
return total;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=sumAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sumAsync.js","sourceRoot":"","sources":["../../../src/async/operators/sumAsync.ts"],"names":[],"mappings":";;AAAA,4BAaC;AAbM,KAAK,UAAU,QAAQ,CAC1B,MAAwB,EACxB,QAA+C;IAE/C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACvD,MAAM,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;QACpE,CAAC;QACD,KAAK,IAAI,KAAK,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"takeAsync.d.ts","sourceRoot":"","sources":["../../../src/async/operators/takeAsync.ts"],"names":[],"mappings":"AAAA,wBAAuB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAO7F"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.takeAsync = takeAsync;
|
|
4
|
+
async function* takeAsync(source, count) {
|
|
5
|
+
let taken = 0;
|
|
6
|
+
for await (const item of source) {
|
|
7
|
+
if (taken >= count)
|
|
8
|
+
break;
|
|
9
|
+
yield item;
|
|
10
|
+
taken++;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=takeAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"takeAsync.js","sourceRoot":"","sources":["../../../src/async/operators/takeAsync.ts"],"names":[],"mappings":";;AAAA,8BAOC;AAPM,KAAK,SAAS,CAAC,CAAC,SAAS,CAAI,MAAwB,EAAE,KAAa;IACvE,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC9B,IAAI,KAAK,IAAI,KAAK;YAAE,MAAM;QAC1B,MAAM,IAAI,CAAC;QACX,KAAK,EAAE,CAAC;IACZ,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toArrayAsync.d.ts","sourceRoot":"","sources":["../../../src/async/operators/toArrayAsync.ts"],"names":[],"mappings":"AAAA,wBAAsB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAM5E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toArrayAsync = toArrayAsync;
|
|
4
|
+
async function toArrayAsync(source) {
|
|
5
|
+
const result = [];
|
|
6
|
+
for await (const item of source) {
|
|
7
|
+
result.push(item);
|
|
8
|
+
}
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=toArrayAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toArrayAsync.js","sourceRoot":"","sources":["../../../src/async/operators/toArrayAsync.ts"],"names":[],"mappings":";;AAAA,oCAMC;AANM,KAAK,UAAU,YAAY,CAAI,MAAwB;IAC1D,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unionAsync.d.ts","sourceRoot":"","sources":["../../../src/async/operators/unionAsync.ts"],"names":[],"mappings":"AAAA,wBAAuB,UAAU,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,EACzC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EACxB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,WAAW,GAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAwB,GACtE,aAAa,CAAC,CAAC,CAAC,CAkBlB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unionAsync = unionAsync;
|
|
4
|
+
async function* unionAsync(source, other, keySelector = ((x) => x)) {
|
|
5
|
+
const seen = new Set();
|
|
6
|
+
for await (const item of source) {
|
|
7
|
+
const key = await keySelector(item);
|
|
8
|
+
if (!seen.has(key)) {
|
|
9
|
+
seen.add(key);
|
|
10
|
+
yield item;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
for await (const item of other) {
|
|
14
|
+
const key = await keySelector(item);
|
|
15
|
+
if (!seen.has(key)) {
|
|
16
|
+
seen.add(key);
|
|
17
|
+
yield item;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=unionAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unionAsync.js","sourceRoot":"","sources":["../../../src/async/operators/unionAsync.ts"],"names":[],"mappings":";;AAAA,gCAsBC;AAtBM,KAAK,SAAS,CAAC,CAAC,UAAU,CAC7B,MAAwB,EACxB,KAAuB,EACvB,cAAiD,CAAC,CAAC,CAAI,EAAE,EAAE,CAAC,CAAC,CAAQ;IAErE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAQ,CAAC;IAE7B,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;QACpC,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,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC7B,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;QACpC,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":"whereAsync.d.ts","sourceRoot":"","sources":["../../../src/async/operators/whereAsync.ts"],"names":[],"mappings":"AAAA,wBAAuB,UAAU,CAAC,CAAC,EAC/B,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EACxB,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAClE,aAAa,CAAC,CAAC,CAAC,CAOlB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.whereAsync = whereAsync;
|
|
4
|
+
async function* whereAsync(source, predicate) {
|
|
5
|
+
let index = 0;
|
|
6
|
+
for await (const item of source) {
|
|
7
|
+
if (await predicate(item, index++)) {
|
|
8
|
+
yield item;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=whereAsync.js.map
|
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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"}
|