@hpcc-js/dataflow 7.0.0 → 8.1.1
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/LICENSE +43 -43
- package/README.md +530 -530
- package/dist/index.js +446 -446
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/lib-es6/__package__.js +3 -3
- package/lib-es6/__package__.js.map +1 -1
- package/lib-es6/__tests__/chain.js +48 -48
- package/lib-es6/__tests__/concat.js +16 -16
- package/lib-es6/__tests__/count.js +18 -18
- package/lib-es6/__tests__/data.js +55 -55
- package/lib-es6/__tests__/deviation.js +12 -12
- package/lib-es6/__tests__/distribution.js +18 -18
- package/lib-es6/__tests__/each.js +11 -11
- package/lib-es6/__tests__/entries.js +12 -12
- package/lib-es6/__tests__/extent.js +18 -18
- package/lib-es6/__tests__/filter.js +13 -13
- package/lib-es6/__tests__/first.js +13 -13
- package/lib-es6/__tests__/generate.js +7 -7
- package/lib-es6/__tests__/group.js +17 -17
- package/lib-es6/__tests__/histogram.js +41 -41
- package/lib-es6/__tests__/map.js +13 -13
- package/lib-es6/__tests__/max.js +29 -29
- package/lib-es6/__tests__/mean.js +9 -9
- package/lib-es6/__tests__/median.js +12 -12
- package/lib-es6/__tests__/min.js +29 -29
- package/lib-es6/__tests__/quartile.js +11 -11
- package/lib-es6/__tests__/readme.js +95 -95
- package/lib-es6/__tests__/reduce.js +14 -14
- package/lib-es6/__tests__/skip.js +13 -13
- package/lib-es6/__tests__/sort.js +18 -18
- package/lib-es6/__tests__/variance.js +12 -12
- package/lib-es6/activities/activity.js +3 -3
- package/lib-es6/activities/concat.js +9 -9
- package/lib-es6/activities/each.js +13 -13
- package/lib-es6/activities/entries.js +12 -12
- package/lib-es6/activities/filter.js +14 -14
- package/lib-es6/activities/first.js +17 -17
- package/lib-es6/activities/group.js +20 -20
- package/lib-es6/activities/histogram.js +63 -63
- package/lib-es6/activities/map.js +12 -12
- package/lib-es6/activities/skip.js +16 -16
- package/lib-es6/activities/sort.js +9 -9
- package/lib-es6/index.js +25 -25
- package/lib-es6/observers/count.js +12 -12
- package/lib-es6/observers/deviation.js +17 -17
- package/lib-es6/observers/distribution.js +35 -35
- package/lib-es6/observers/extent.js +17 -17
- package/lib-es6/observers/max.js +18 -18
- package/lib-es6/observers/mean.js +20 -20
- package/lib-es6/observers/median.js +25 -25
- package/lib-es6/observers/min.js +18 -18
- package/lib-es6/observers/observer.js +34 -34
- package/lib-es6/observers/quartile.js +37 -37
- package/lib-es6/observers/reduce.js +17 -17
- package/lib-es6/observers/variance.js +22 -22
- package/lib-es6/utils/generate.js +6 -6
- package/lib-es6/utils/pipe.js +31 -31
- package/package.json +8 -24
- package/src/__package__.ts +3 -3
- package/src/__tests__/chain.ts +85 -85
- package/src/__tests__/concat.ts +18 -18
- package/src/__tests__/count.ts +25 -25
- package/src/__tests__/data.ts +64 -64
- package/src/__tests__/deviation.ts +14 -14
- package/src/__tests__/distribution.ts +21 -21
- package/src/__tests__/each.ts +13 -13
- package/src/__tests__/entries.ts +14 -14
- package/src/__tests__/extent.ts +25 -25
- package/src/__tests__/filter.ts +16 -16
- package/src/__tests__/first.ts +15 -15
- package/src/__tests__/generate.ts +9 -9
- package/src/__tests__/group.ts +19 -19
- package/src/__tests__/histogram.ts +47 -47
- package/src/__tests__/map.ts +16 -16
- package/src/__tests__/max.ts +42 -42
- package/src/__tests__/mean.ts +11 -11
- package/src/__tests__/median.ts +14 -14
- package/src/__tests__/min.ts +42 -42
- package/src/__tests__/quartile.ts +14 -14
- package/src/__tests__/readme.ts +113 -113
- package/src/__tests__/reduce.ts +17 -17
- package/src/__tests__/skip.ts +15 -15
- package/src/__tests__/sort.ts +21 -21
- package/src/__tests__/variance.ts +14 -14
- package/src/activities/activity.ts +8 -8
- package/src/activities/concat.ts +14 -14
- package/src/activities/each.ts +19 -19
- package/src/activities/entries.ts +17 -17
- package/src/activities/filter.ts +20 -20
- package/src/activities/first.ts +20 -20
- package/src/activities/group.ts +27 -27
- package/src/activities/histogram.ts +78 -78
- package/src/activities/map.ts +18 -18
- package/src/activities/skip.ts +19 -19
- package/src/activities/sort.ts +16 -16
- package/src/index.ts +25 -25
- package/src/observers/count.ts +15 -15
- package/src/observers/deviation.ts +24 -24
- package/src/observers/distribution.ts +51 -51
- package/src/observers/extent.ts +24 -24
- package/src/observers/max.ts +24 -24
- package/src/observers/mean.ts +26 -26
- package/src/observers/median.ts +30 -30
- package/src/observers/min.ts +24 -24
- package/src/observers/observer.ts +52 -52
- package/src/observers/quartile.ts +43 -43
- package/src/observers/reduce.ts +22 -22
- package/src/observers/variance.ts +29 -29
- package/src/utils/generate.ts +6 -6
- package/src/utils/pipe.ts +74 -74
- package/types/__package__.d.ts +3 -3
- package/types/__package__.d.ts.map +1 -1
- package/types/__tests__/chain.d.ts +1 -1
- package/types/__tests__/concat.d.ts +1 -1
- package/types/__tests__/count.d.ts +1 -1
- package/types/__tests__/data.d.ts +61 -61
- package/types/__tests__/deviation.d.ts +1 -1
- package/types/__tests__/distribution.d.ts +1 -1
- package/types/__tests__/each.d.ts +1 -1
- package/types/__tests__/entries.d.ts +1 -1
- package/types/__tests__/extent.d.ts +1 -1
- package/types/__tests__/filter.d.ts +1 -1
- package/types/__tests__/first.d.ts +1 -1
- package/types/__tests__/generate.d.ts +1 -1
- package/types/__tests__/group.d.ts +1 -1
- package/types/__tests__/histogram.d.ts +1 -1
- package/types/__tests__/map.d.ts +1 -1
- package/types/__tests__/max.d.ts +1 -1
- package/types/__tests__/mean.d.ts +1 -1
- package/types/__tests__/median.d.ts +1 -1
- package/types/__tests__/min.d.ts +1 -1
- package/types/__tests__/quartile.d.ts +1 -1
- package/types/__tests__/readme.d.ts +1 -1
- package/types/__tests__/reduce.d.ts +1 -1
- package/types/__tests__/skip.d.ts +1 -1
- package/types/__tests__/sort.d.ts +1 -1
- package/types/__tests__/variance.d.ts +1 -1
- package/types/activities/activity.d.ts +5 -5
- package/types/activities/concat.d.ts +3 -3
- package/types/activities/each.d.ts +4 -4
- package/types/activities/entries.d.ts +3 -3
- package/types/activities/filter.d.ts +4 -4
- package/types/activities/first.d.ts +3 -3
- package/types/activities/group.d.ts +8 -8
- package/types/activities/histogram.d.ts +17 -17
- package/types/activities/map.d.ts +4 -4
- package/types/activities/skip.d.ts +3 -3
- package/types/activities/sort.d.ts +4 -4
- package/types/index.d.ts +25 -25
- package/types/observers/count.d.ts +2 -2
- package/types/observers/deviation.d.ts +4 -4
- package/types/observers/distribution.d.ts +12 -12
- package/types/observers/extent.d.ts +4 -4
- package/types/observers/max.d.ts +4 -4
- package/types/observers/mean.d.ts +4 -4
- package/types/observers/median.d.ts +4 -4
- package/types/observers/min.d.ts +4 -4
- package/types/observers/observer.d.ts +13 -13
- package/types/observers/quartile.d.ts +5 -5
- package/types/observers/reduce.d.ts +3 -3
- package/types/observers/variance.d.ts +4 -4
- package/types/utils/generate.d.ts +1 -1
- package/types/utils/pipe.d.ts +41 -41
- package/types-3.4/__package__.d.ts +2 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { isSource } from "./activity";
|
|
2
|
-
function filterGen(callbackFn) {
|
|
3
|
-
return function* (source) {
|
|
4
|
-
let i = -1;
|
|
5
|
-
for (const item of source) {
|
|
6
|
-
if (callbackFn(item, ++i)) {
|
|
7
|
-
yield item;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export function filter(s_or_cb, callbackFn) {
|
|
13
|
-
return isSource(s_or_cb) ? filterGen(callbackFn)(s_or_cb) : filterGen(s_or_cb);
|
|
14
|
-
}
|
|
1
|
+
import { isSource } from "./activity";
|
|
2
|
+
function filterGen(callbackFn) {
|
|
3
|
+
return function* (source) {
|
|
4
|
+
let i = -1;
|
|
5
|
+
for (const item of source) {
|
|
6
|
+
if (callbackFn(item, ++i)) {
|
|
7
|
+
yield item;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function filter(s_or_cb, callbackFn) {
|
|
13
|
+
return isSource(s_or_cb) ? filterGen(callbackFn)(s_or_cb) : filterGen(s_or_cb);
|
|
14
|
+
}
|
|
15
15
|
//# sourceMappingURL=filter.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { isSource } from "./activity";
|
|
2
|
-
function firstGen(n) {
|
|
3
|
-
return function* (source) {
|
|
4
|
-
let i = 0;
|
|
5
|
-
for (const item of source) {
|
|
6
|
-
yield item;
|
|
7
|
-
if (++i >= n) {
|
|
8
|
-
break;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export function first(s_or_n, n) {
|
|
14
|
-
if (!isSource(s_or_n))
|
|
15
|
-
return firstGen(s_or_n);
|
|
16
|
-
return firstGen(n)(s_or_n);
|
|
17
|
-
}
|
|
1
|
+
import { isSource } from "./activity";
|
|
2
|
+
function firstGen(n) {
|
|
3
|
+
return function* (source) {
|
|
4
|
+
let i = 0;
|
|
5
|
+
for (const item of source) {
|
|
6
|
+
yield item;
|
|
7
|
+
if (++i >= n) {
|
|
8
|
+
break;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export function first(s_or_n, n) {
|
|
14
|
+
if (!isSource(s_or_n))
|
|
15
|
+
return firstGen(s_or_n);
|
|
16
|
+
return firstGen(n)(s_or_n);
|
|
17
|
+
}
|
|
18
18
|
//# sourceMappingURL=first.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { isSource } from "./activity";
|
|
2
|
-
function groupGen(groupFn) {
|
|
3
|
-
return function* (source) {
|
|
4
|
-
let i = -1;
|
|
5
|
-
const group = {};
|
|
6
|
-
for (const row of source) {
|
|
7
|
-
const key = groupFn(row, ++i);
|
|
8
|
-
if (!group[key]) {
|
|
9
|
-
group[key] = [];
|
|
10
|
-
}
|
|
11
|
-
group[key].push(row);
|
|
12
|
-
}
|
|
13
|
-
for (const key in group) {
|
|
14
|
-
yield { key, value: group[key] };
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export function group(s_or_gbf, groupByFn) {
|
|
19
|
-
return isSource(s_or_gbf) ? groupGen(groupByFn)(s_or_gbf) : groupGen(s_or_gbf);
|
|
20
|
-
}
|
|
1
|
+
import { isSource } from "./activity";
|
|
2
|
+
function groupGen(groupFn) {
|
|
3
|
+
return function* (source) {
|
|
4
|
+
let i = -1;
|
|
5
|
+
const group = {};
|
|
6
|
+
for (const row of source) {
|
|
7
|
+
const key = groupFn(row, ++i);
|
|
8
|
+
if (!group[key]) {
|
|
9
|
+
group[key] = [];
|
|
10
|
+
}
|
|
11
|
+
group[key].push(row);
|
|
12
|
+
}
|
|
13
|
+
for (const key in group) {
|
|
14
|
+
yield { key, value: group[key] };
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function group(s_or_gbf, groupByFn) {
|
|
19
|
+
return isSource(s_or_gbf) ? groupGen(groupByFn)(s_or_gbf) : groupGen(s_or_gbf);
|
|
20
|
+
}
|
|
21
21
|
//# sourceMappingURL=group.js.map
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { isSource } from "./activity";
|
|
2
|
-
import { extent } from "../observers/extent";
|
|
3
|
-
import { scalar } from "../observers/observer";
|
|
4
|
-
function isOptionA(_) {
|
|
5
|
-
return _.buckets !== undefined;
|
|
6
|
-
}
|
|
7
|
-
function histogramGen(callbackFn, options) {
|
|
8
|
-
return function* (_source) {
|
|
9
|
-
let min;
|
|
10
|
-
let bucketSize;
|
|
11
|
-
let source;
|
|
12
|
-
if (isOptionA(options)) {
|
|
13
|
-
source = Array.isArray(_source) ? _source : [..._source];
|
|
14
|
-
const minMax = scalar(extent(callbackFn))(source);
|
|
15
|
-
if (minMax === undefined) {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
min = minMax[0];
|
|
19
|
-
const max = minMax[1];
|
|
20
|
-
const buckets = options.buckets;
|
|
21
|
-
bucketSize = (max - min) / buckets;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
source = _source;
|
|
25
|
-
min = options.min;
|
|
26
|
-
bucketSize = options.range;
|
|
27
|
-
}
|
|
28
|
-
const histogram = {};
|
|
29
|
-
let maxBucketID = 0;
|
|
30
|
-
for (const row of source) {
|
|
31
|
-
const value = callbackFn(row);
|
|
32
|
-
const bucketID = Math.floor((value - min) / bucketSize);
|
|
33
|
-
if (maxBucketID < bucketID) {
|
|
34
|
-
maxBucketID = bucketID;
|
|
35
|
-
}
|
|
36
|
-
if (histogram[bucketID] === undefined) {
|
|
37
|
-
histogram[bucketID] = [];
|
|
38
|
-
}
|
|
39
|
-
histogram[bucketID].push(row);
|
|
40
|
-
}
|
|
41
|
-
const lastBucket = histogram[maxBucketID];
|
|
42
|
-
const from = min + maxBucketID * bucketSize;
|
|
43
|
-
for (let i = 0; i <= maxBucketID; ++i) {
|
|
44
|
-
// If all items in the last bucket match the "to" of the previous bucket, put them in there...
|
|
45
|
-
if (i === maxBucketID - 1 && lastBucket.every(row => from === callbackFn(row))) {
|
|
46
|
-
yield {
|
|
47
|
-
from: min + i * bucketSize,
|
|
48
|
-
to: min + (i + 1) * bucketSize,
|
|
49
|
-
value: [...(histogram[i] || []), ...lastBucket]
|
|
50
|
-
};
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
yield {
|
|
54
|
-
from: min + i * bucketSize,
|
|
55
|
-
to: min + (i + 1) * bucketSize,
|
|
56
|
-
value: histogram[i] || []
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
export function histogram(s_or_hf, hf_or_b, options) {
|
|
62
|
-
return isSource(s_or_hf) ? histogramGen(hf_or_b, options)(s_or_hf) : histogramGen(s_or_hf, hf_or_b);
|
|
63
|
-
}
|
|
1
|
+
import { isSource } from "./activity";
|
|
2
|
+
import { extent } from "../observers/extent";
|
|
3
|
+
import { scalar } from "../observers/observer";
|
|
4
|
+
function isOptionA(_) {
|
|
5
|
+
return _.buckets !== undefined;
|
|
6
|
+
}
|
|
7
|
+
function histogramGen(callbackFn, options) {
|
|
8
|
+
return function* (_source) {
|
|
9
|
+
let min;
|
|
10
|
+
let bucketSize;
|
|
11
|
+
let source;
|
|
12
|
+
if (isOptionA(options)) {
|
|
13
|
+
source = Array.isArray(_source) ? _source : [..._source];
|
|
14
|
+
const minMax = scalar(extent(callbackFn))(source);
|
|
15
|
+
if (minMax === undefined) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
min = minMax[0];
|
|
19
|
+
const max = minMax[1];
|
|
20
|
+
const buckets = options.buckets;
|
|
21
|
+
bucketSize = (max - min) / buckets;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
source = _source;
|
|
25
|
+
min = options.min;
|
|
26
|
+
bucketSize = options.range;
|
|
27
|
+
}
|
|
28
|
+
const histogram = {};
|
|
29
|
+
let maxBucketID = 0;
|
|
30
|
+
for (const row of source) {
|
|
31
|
+
const value = callbackFn(row);
|
|
32
|
+
const bucketID = Math.floor((value - min) / bucketSize);
|
|
33
|
+
if (maxBucketID < bucketID) {
|
|
34
|
+
maxBucketID = bucketID;
|
|
35
|
+
}
|
|
36
|
+
if (histogram[bucketID] === undefined) {
|
|
37
|
+
histogram[bucketID] = [];
|
|
38
|
+
}
|
|
39
|
+
histogram[bucketID].push(row);
|
|
40
|
+
}
|
|
41
|
+
const lastBucket = histogram[maxBucketID];
|
|
42
|
+
const from = min + maxBucketID * bucketSize;
|
|
43
|
+
for (let i = 0; i <= maxBucketID; ++i) {
|
|
44
|
+
// If all items in the last bucket match the "to" of the previous bucket, put them in there...
|
|
45
|
+
if (i === maxBucketID - 1 && lastBucket.every(row => from === callbackFn(row))) {
|
|
46
|
+
yield {
|
|
47
|
+
from: min + i * bucketSize,
|
|
48
|
+
to: min + (i + 1) * bucketSize,
|
|
49
|
+
value: [...(histogram[i] || []), ...lastBucket]
|
|
50
|
+
};
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
yield {
|
|
54
|
+
from: min + i * bucketSize,
|
|
55
|
+
to: min + (i + 1) * bucketSize,
|
|
56
|
+
value: histogram[i] || []
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export function histogram(s_or_hf, hf_or_b, options) {
|
|
62
|
+
return isSource(s_or_hf) ? histogramGen(hf_or_b, options)(s_or_hf) : histogramGen(s_or_hf, hf_or_b);
|
|
63
|
+
}
|
|
64
64
|
//# sourceMappingURL=histogram.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { isSource } from "./activity";
|
|
2
|
-
function mapGen(callbackFn) {
|
|
3
|
-
return function* (source) {
|
|
4
|
-
let i = -1;
|
|
5
|
-
for (const item of source) {
|
|
6
|
-
yield callbackFn(item, ++i);
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export function map(s_or_cb, callbackFn) {
|
|
11
|
-
return isSource(s_or_cb) ? mapGen(callbackFn)(s_or_cb) : mapGen(s_or_cb);
|
|
12
|
-
}
|
|
1
|
+
import { isSource } from "./activity";
|
|
2
|
+
function mapGen(callbackFn) {
|
|
3
|
+
return function* (source) {
|
|
4
|
+
let i = -1;
|
|
5
|
+
for (const item of source) {
|
|
6
|
+
yield callbackFn(item, ++i);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export function map(s_or_cb, callbackFn) {
|
|
11
|
+
return isSource(s_or_cb) ? mapGen(callbackFn)(s_or_cb) : mapGen(s_or_cb);
|
|
12
|
+
}
|
|
13
13
|
//# sourceMappingURL=map.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { isSource } from "./activity";
|
|
2
|
-
function skipGen(n) {
|
|
3
|
-
return function* (source) {
|
|
4
|
-
let i = -1;
|
|
5
|
-
for (const item of source) {
|
|
6
|
-
if (++i >= n) {
|
|
7
|
-
yield item;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export function skip(s_or_n, n) {
|
|
13
|
-
if (!isSource(s_or_n))
|
|
14
|
-
return skipGen(s_or_n);
|
|
15
|
-
return skipGen(n)(s_or_n);
|
|
16
|
-
}
|
|
1
|
+
import { isSource } from "./activity";
|
|
2
|
+
function skipGen(n) {
|
|
3
|
+
return function* (source) {
|
|
4
|
+
let i = -1;
|
|
5
|
+
for (const item of source) {
|
|
6
|
+
if (++i >= n) {
|
|
7
|
+
yield item;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function skip(s_or_n, n) {
|
|
13
|
+
if (!isSource(s_or_n))
|
|
14
|
+
return skipGen(s_or_n);
|
|
15
|
+
return skipGen(n)(s_or_n);
|
|
16
|
+
}
|
|
17
17
|
//# sourceMappingURL=skip.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { isSource } from "./activity";
|
|
2
|
-
function sortGen(compareFn) {
|
|
3
|
-
return function* (source) {
|
|
4
|
-
yield* (Array.isArray(source) ? source : [...source]).sort(compareFn);
|
|
5
|
-
};
|
|
6
|
-
}
|
|
7
|
-
export function sort(s_or_cb, callbackFn) {
|
|
8
|
-
return isSource(s_or_cb) ? sortGen(callbackFn)(s_or_cb) : sortGen(s_or_cb);
|
|
9
|
-
}
|
|
1
|
+
import { isSource } from "./activity";
|
|
2
|
+
function sortGen(compareFn) {
|
|
3
|
+
return function* (source) {
|
|
4
|
+
yield* (Array.isArray(source) ? source : [...source]).sort(compareFn);
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export function sort(s_or_cb, callbackFn) {
|
|
8
|
+
return isSource(s_or_cb) ? sortGen(callbackFn)(s_or_cb) : sortGen(s_or_cb);
|
|
9
|
+
}
|
|
10
10
|
//# sourceMappingURL=sort.js.map
|
package/lib-es6/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export * from "./activities/activity";
|
|
2
|
-
export * from "./activities/concat";
|
|
3
|
-
export * from "./activities/each";
|
|
4
|
-
export * from "./activities/entries";
|
|
5
|
-
export * from "./activities/filter";
|
|
6
|
-
export * from "./activities/first";
|
|
7
|
-
export * from "./activities/group";
|
|
8
|
-
export * from "./activities/histogram";
|
|
9
|
-
export * from "./activities/map";
|
|
10
|
-
export * from "./activities/skip";
|
|
11
|
-
export * from "./activities/sort";
|
|
12
|
-
export * from "./observers/count";
|
|
13
|
-
export * from "./observers/deviation";
|
|
14
|
-
export * from "./observers/distribution";
|
|
15
|
-
export * from "./observers/extent";
|
|
16
|
-
export * from "./observers/observer";
|
|
17
|
-
export * from "./observers/max";
|
|
18
|
-
export * from "./observers/mean";
|
|
19
|
-
export * from "./observers/median";
|
|
20
|
-
export * from "./observers/min";
|
|
21
|
-
export * from "./observers/quartile";
|
|
22
|
-
export * from "./observers/reduce";
|
|
23
|
-
export * from "./observers/variance";
|
|
24
|
-
export * from "./utils/generate";
|
|
25
|
-
export * from "./utils/pipe";
|
|
1
|
+
export * from "./activities/activity";
|
|
2
|
+
export * from "./activities/concat";
|
|
3
|
+
export * from "./activities/each";
|
|
4
|
+
export * from "./activities/entries";
|
|
5
|
+
export * from "./activities/filter";
|
|
6
|
+
export * from "./activities/first";
|
|
7
|
+
export * from "./activities/group";
|
|
8
|
+
export * from "./activities/histogram";
|
|
9
|
+
export * from "./activities/map";
|
|
10
|
+
export * from "./activities/skip";
|
|
11
|
+
export * from "./activities/sort";
|
|
12
|
+
export * from "./observers/count";
|
|
13
|
+
export * from "./observers/deviation";
|
|
14
|
+
export * from "./observers/distribution";
|
|
15
|
+
export * from "./observers/extent";
|
|
16
|
+
export * from "./observers/observer";
|
|
17
|
+
export * from "./observers/max";
|
|
18
|
+
export * from "./observers/mean";
|
|
19
|
+
export * from "./observers/median";
|
|
20
|
+
export * from "./observers/min";
|
|
21
|
+
export * from "./observers/quartile";
|
|
22
|
+
export * from "./observers/reduce";
|
|
23
|
+
export * from "./observers/variance";
|
|
24
|
+
export * from "./utils/generate";
|
|
25
|
+
export * from "./utils/pipe";
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export function count() {
|
|
2
|
-
let count;
|
|
3
|
-
return {
|
|
4
|
-
observe: (value, idx) => {
|
|
5
|
-
if (idx === 0) {
|
|
6
|
-
count = 0;
|
|
7
|
-
}
|
|
8
|
-
++count;
|
|
9
|
-
},
|
|
10
|
-
peek: () => count
|
|
11
|
-
};
|
|
12
|
-
}
|
|
1
|
+
export function count() {
|
|
2
|
+
let count;
|
|
3
|
+
return {
|
|
4
|
+
observe: (value, idx) => {
|
|
5
|
+
if (idx === 0) {
|
|
6
|
+
count = 0;
|
|
7
|
+
}
|
|
8
|
+
++count;
|
|
9
|
+
},
|
|
10
|
+
peek: () => count
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
13
|
//# sourceMappingURL=count.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { variance } from "./variance";
|
|
2
|
-
import { Accessor } from "./observer";
|
|
3
|
-
function _deviation() {
|
|
4
|
-
const v = variance();
|
|
5
|
-
return {
|
|
6
|
-
observe: (value, idx) => {
|
|
7
|
-
v.observe(value, idx);
|
|
8
|
-
},
|
|
9
|
-
peek: () => {
|
|
10
|
-
const variance = v.peek();
|
|
11
|
-
return variance !== undefined ? Math.sqrt(variance) : variance;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export function deviation(callbackFn) {
|
|
16
|
-
return callbackFn ? Accessor(_deviation, callbackFn) : _deviation();
|
|
17
|
-
}
|
|
1
|
+
import { variance } from "./variance";
|
|
2
|
+
import { Accessor } from "./observer";
|
|
3
|
+
function _deviation() {
|
|
4
|
+
const v = variance();
|
|
5
|
+
return {
|
|
6
|
+
observe: (value, idx) => {
|
|
7
|
+
v.observe(value, idx);
|
|
8
|
+
},
|
|
9
|
+
peek: () => {
|
|
10
|
+
const variance = v.peek();
|
|
11
|
+
return variance !== undefined ? Math.sqrt(variance) : variance;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function deviation(callbackFn) {
|
|
16
|
+
return callbackFn ? Accessor(_deviation, callbackFn) : _deviation();
|
|
17
|
+
}
|
|
18
18
|
//# sourceMappingURL=deviation.js.map
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { max } from "./max";
|
|
2
|
-
import { min } from "./min";
|
|
3
|
-
import { mean } from "./mean";
|
|
4
|
-
import { variance } from "./variance";
|
|
5
|
-
import { Accessor } from "./observer";
|
|
6
|
-
function _distribution() {
|
|
7
|
-
const minFO = min();
|
|
8
|
-
const maxFO = max();
|
|
9
|
-
const meanFO = mean();
|
|
10
|
-
const varianceFO = variance();
|
|
11
|
-
return {
|
|
12
|
-
observe: (value, idx) => {
|
|
13
|
-
minFO.observe(value, idx);
|
|
14
|
-
maxFO.observe(value, idx);
|
|
15
|
-
meanFO.observe(value, idx);
|
|
16
|
-
varianceFO.observe(value, idx);
|
|
17
|
-
},
|
|
18
|
-
peek: () => {
|
|
19
|
-
const minResult = minFO.peek();
|
|
20
|
-
if (minResult === undefined)
|
|
21
|
-
return undefined;
|
|
22
|
-
const varianceResult = varianceFO.peek();
|
|
23
|
-
return {
|
|
24
|
-
min: minResult,
|
|
25
|
-
max: maxFO.peek(),
|
|
26
|
-
mean: meanFO.peek(),
|
|
27
|
-
variance: varianceResult,
|
|
28
|
-
deviation: varianceResult !== undefined ? Math.sqrt(varianceResult) : undefined
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export function distribution(callbackFn) {
|
|
34
|
-
return callbackFn ? Accessor(_distribution, callbackFn) : _distribution();
|
|
35
|
-
}
|
|
1
|
+
import { max } from "./max";
|
|
2
|
+
import { min } from "./min";
|
|
3
|
+
import { mean } from "./mean";
|
|
4
|
+
import { variance } from "./variance";
|
|
5
|
+
import { Accessor } from "./observer";
|
|
6
|
+
function _distribution() {
|
|
7
|
+
const minFO = min();
|
|
8
|
+
const maxFO = max();
|
|
9
|
+
const meanFO = mean();
|
|
10
|
+
const varianceFO = variance();
|
|
11
|
+
return {
|
|
12
|
+
observe: (value, idx) => {
|
|
13
|
+
minFO.observe(value, idx);
|
|
14
|
+
maxFO.observe(value, idx);
|
|
15
|
+
meanFO.observe(value, idx);
|
|
16
|
+
varianceFO.observe(value, idx);
|
|
17
|
+
},
|
|
18
|
+
peek: () => {
|
|
19
|
+
const minResult = minFO.peek();
|
|
20
|
+
if (minResult === undefined)
|
|
21
|
+
return undefined;
|
|
22
|
+
const varianceResult = varianceFO.peek();
|
|
23
|
+
return {
|
|
24
|
+
min: minResult,
|
|
25
|
+
max: maxFO.peek(),
|
|
26
|
+
mean: meanFO.peek(),
|
|
27
|
+
variance: varianceResult,
|
|
28
|
+
deviation: varianceResult !== undefined ? Math.sqrt(varianceResult) : undefined
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function distribution(callbackFn) {
|
|
34
|
+
return callbackFn ? Accessor(_distribution, callbackFn) : _distribution();
|
|
35
|
+
}
|
|
36
36
|
//# sourceMappingURL=distribution.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Accessor } from "./observer";
|
|
2
|
-
import { max } from "./max";
|
|
3
|
-
import { min } from "./min";
|
|
4
|
-
function _extent() {
|
|
5
|
-
const minFO = min();
|
|
6
|
-
const maxFO = max();
|
|
7
|
-
return {
|
|
8
|
-
observe: (value, idx) => {
|
|
9
|
-
minFO.observe(value, idx);
|
|
10
|
-
maxFO.observe(value, idx);
|
|
11
|
-
},
|
|
12
|
-
peek: () => [minFO.peek(), maxFO.peek()]
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export function extent(callbackFn) {
|
|
16
|
-
return callbackFn ? Accessor(_extent, callbackFn) : _extent();
|
|
17
|
-
}
|
|
1
|
+
import { Accessor } from "./observer";
|
|
2
|
+
import { max } from "./max";
|
|
3
|
+
import { min } from "./min";
|
|
4
|
+
function _extent() {
|
|
5
|
+
const minFO = min();
|
|
6
|
+
const maxFO = max();
|
|
7
|
+
return {
|
|
8
|
+
observe: (value, idx) => {
|
|
9
|
+
minFO.observe(value, idx);
|
|
10
|
+
maxFO.observe(value, idx);
|
|
11
|
+
},
|
|
12
|
+
peek: () => [minFO.peek(), maxFO.peek()]
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function extent(callbackFn) {
|
|
16
|
+
return callbackFn ? Accessor(_extent, callbackFn) : _extent();
|
|
17
|
+
}
|
|
18
18
|
//# sourceMappingURL=extent.js.map
|
package/lib-es6/observers/max.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Accessor } from "./observer";
|
|
2
|
-
function _max() {
|
|
3
|
-
let max;
|
|
4
|
-
return {
|
|
5
|
-
observe: (value, idx) => {
|
|
6
|
-
if (idx === 0) {
|
|
7
|
-
max = value;
|
|
8
|
-
}
|
|
9
|
-
else if (max < value) {
|
|
10
|
-
max = value;
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
peek: () => max
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export function max(callbackFn) {
|
|
17
|
-
return callbackFn ? Accessor(_max, callbackFn) : _max();
|
|
18
|
-
}
|
|
1
|
+
import { Accessor } from "./observer";
|
|
2
|
+
function _max() {
|
|
3
|
+
let max;
|
|
4
|
+
return {
|
|
5
|
+
observe: (value, idx) => {
|
|
6
|
+
if (idx === 0) {
|
|
7
|
+
max = value;
|
|
8
|
+
}
|
|
9
|
+
else if (max < value) {
|
|
10
|
+
max = value;
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
peek: () => max
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function max(callbackFn) {
|
|
17
|
+
return callbackFn ? Accessor(_max, callbackFn) : _max();
|
|
18
|
+
}
|
|
19
19
|
//# sourceMappingURL=max.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Accessor } from "./observer";
|
|
2
|
-
function _mean() {
|
|
3
|
-
let total;
|
|
4
|
-
let count;
|
|
5
|
-
return {
|
|
6
|
-
observe: (value, idx) => {
|
|
7
|
-
if (idx === 0) {
|
|
8
|
-
total = value;
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
total += value;
|
|
12
|
-
}
|
|
13
|
-
count = idx;
|
|
14
|
-
},
|
|
15
|
-
peek: () => total / (count + 1)
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export function mean(callbackFn) {
|
|
19
|
-
return callbackFn ? Accessor(_mean, callbackFn) : _mean();
|
|
20
|
-
}
|
|
1
|
+
import { Accessor } from "./observer";
|
|
2
|
+
function _mean() {
|
|
3
|
+
let total;
|
|
4
|
+
let count;
|
|
5
|
+
return {
|
|
6
|
+
observe: (value, idx) => {
|
|
7
|
+
if (idx === 0) {
|
|
8
|
+
total = value;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
total += value;
|
|
12
|
+
}
|
|
13
|
+
count = idx;
|
|
14
|
+
},
|
|
15
|
+
peek: () => total / (count + 1)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function mean(callbackFn) {
|
|
19
|
+
return callbackFn ? Accessor(_mean, callbackFn) : _mean();
|
|
20
|
+
}
|
|
21
21
|
//# sourceMappingURL=mean.js.map
|