@thi.ng/transducers-stats 2.1.117 → 2.1.118

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-04-23T07:02:19Z
3
+ - **Last updated**: 2024-05-08T18:24:32Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/macd.js CHANGED
@@ -11,12 +11,10 @@ function macd(...args) {
11
11
  return compR(rfn, (acc, x) => {
12
12
  const fast = maFast(x);
13
13
  const slow = maSlow(x);
14
- if (slow == null)
15
- return acc;
14
+ if (slow == null) return acc;
16
15
  const macd2 = fast - slow;
17
16
  const signal = maSmooth(macd2);
18
- if (signal == null)
19
- return acc;
17
+ if (signal == null) return acc;
20
18
  return reduce(acc, {
21
19
  macd: macd2,
22
20
  signal,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/transducers-stats",
3
- "version": "2.1.117",
3
+ "version": "2.1.118",
4
4
  "description": "Transducers for statistical / technical analysis",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -36,16 +36,16 @@
36
36
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@thi.ng/checks": "^3.6.3",
40
- "@thi.ng/dcons": "^3.2.112",
41
- "@thi.ng/errors": "^2.5.6",
42
- "@thi.ng/transducers": "^9.0.4"
39
+ "@thi.ng/checks": "^3.6.4",
40
+ "@thi.ng/dcons": "^3.2.113",
41
+ "@thi.ng/errors": "^2.5.7",
42
+ "@thi.ng/transducers": "^9.0.5"
43
43
  },
44
44
  "devDependencies": {
45
- "@microsoft/api-extractor": "^7.43.0",
46
- "esbuild": "^0.20.2",
47
- "typedoc": "^0.25.12",
48
- "typescript": "^5.4.3"
45
+ "@microsoft/api-extractor": "^7.43.2",
46
+ "esbuild": "^0.21.1",
47
+ "typedoc": "^0.25.13",
48
+ "typescript": "^5.4.5"
49
49
  },
50
50
  "keywords": [
51
51
  "analysis",
@@ -131,5 +131,5 @@
131
131
  "parent": "@thi.ng/transducers",
132
132
  "year": 2017
133
133
  },
134
- "gitHead": "aed3421c21044c005fbcb7cc37965ccf85a870d2\n"
134
+ "gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n"
135
135
  }
package/stochastic.js CHANGED
@@ -11,15 +11,12 @@ function stochastic(...args) {
11
11
  const ma2 = step(sma(args[2] || 3));
12
12
  return compR(rfn, (acc, x) => {
13
13
  const b = xfD(x);
14
- if (b == null)
15
- return acc;
14
+ if (b == null) return acc;
16
15
  const k = (x - b[0]) / (b[1] - b[0]);
17
16
  const d1 = ma1(k);
18
- if (d1 == null)
19
- return acc;
17
+ if (d1 == null) return acc;
20
18
  const d2 = ma2(d1);
21
- if (d2 == null)
22
- return acc;
19
+ if (d2 == null) return acc;
23
20
  return reduce(acc, { k, d1, d2 });
24
21
  });
25
22
  });