fix: correct RelativeStrengthAB binding wrapper casing (#296)

The WASM and Node binding wrappers were named with the lowercase-b acronym
(WasmRelativeStrengthAb, RelativeStrengthAbNode) while the core type and every
other surface use RelativeStrengthAB. The published JS/WASM class name was
already correct via js_name/js_class, so this only aligns the internal Rust
identifiers and the auto-generated TypeScript type alias
(RelativeStrengthAbNode -> RelativeStrengthABNode). Runtime API unchanged.
This commit is contained in:
kingchenc
2026-06-14 00:50:03 +02:00
committed by GitHub
parent eb50ae4e90
commit d9e6807ca0
4 changed files with 15 additions and 6 deletions
+9
View File
@@ -18,6 +18,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Python binding: upgraded `pyo3` and `rust-numpy` from 0.28 to 0.29. No public
API changes; the full test suite passes unchanged.
### Fixed
- Corrected the internal casing of the `RelativeStrengthAB` binding wrappers,
which used `...Ab` (`WasmRelativeStrengthAb` in the WASM crate,
`RelativeStrengthAbNode` in the Node crate) while every other surface uses the
acronym `AB`. The published JS/WASM class name was already `RelativeStrengthAB`
(set via `js_name`/`js_class`), so the runtime API is unchanged; the only
visible change is the auto-generated TypeScript type alias, renamed
`RelativeStrengthAbNode``RelativeStrengthABNode` in `index.d.ts`.
### Security
- Resolved the pyo3 advisories RUSTSEC-2026-0176 (out-of-bounds read in
`PyList`/`PyTuple` `nth`/`nth_back`) and RUSTSEC-2026-0177 (missing `Sync`
+1 -1
View File
@@ -1645,7 +1645,7 @@ export declare class Cointegration {
isReady(): boolean
warmupPeriod(): number
}
export type RelativeStrengthAbNode = RelativeStrengthAB
export type RelativeStrengthABNode = RelativeStrengthAB
export declare class RelativeStrengthAB {
constructor(maPeriod: number, rsiPeriod: number)
update(a: number, b: number): RelativeStrengthValue | null
+2 -2
View File
@@ -1174,12 +1174,12 @@ pub struct RelativeStrengthValue {
}
#[napi(js_name = "RelativeStrengthAB")]
pub struct RelativeStrengthAbNode {
pub struct RelativeStrengthABNode {
inner: wc::RelativeStrengthAB,
}
#[napi]
impl RelativeStrengthAbNode {
impl RelativeStrengthABNode {
#[napi(constructor)]
pub fn new(ma_period: u32, rsi_period: u32) -> napi::Result<Self> {
Ok(Self {
+3 -3
View File
@@ -730,14 +730,14 @@ impl WasmCointegration {
// ---------- RelativeStrengthAB (two params, object output) ----------
#[wasm_bindgen(js_name = "RelativeStrengthAB")]
pub struct WasmRelativeStrengthAb {
pub struct WasmRelativeStrengthAB {
inner: wc::RelativeStrengthAB,
}
#[wasm_bindgen(js_class = "RelativeStrengthAB")]
impl WasmRelativeStrengthAb {
impl WasmRelativeStrengthAB {
#[wasm_bindgen(constructor)]
pub fn new(ma_period: usize, rsi_period: usize) -> Result<WasmRelativeStrengthAb, JsError> {
pub fn new(ma_period: usize, rsi_period: usize) -> Result<WasmRelativeStrengthAB, JsError> {
Ok(Self {
inner: wc::RelativeStrengthAB::new(ma_period, rsi_period).map_err(map_err)?,
})