Skip to content

v0.3.3 — README example bugfix

Choose a tag to compare

@alexanderbering alexanderbering released this 08 May 18:03
· 85 commits to main since this release

What's new in v0.3.3

Bugfix release — no API changes, no behavior changes. Fixes a copy-paste-breaking error in the README "Want the advanced algorithms?" example.

What changed

The example in the root README (line ~118) called:

// ❌ wrong (the snippet shipped in v0.3.0–0.3.2 README)
const pe = computeKGPredictionError({ predicted: 0.9, observed: 0.4 });
const nextInterval = computeAdaptiveFSRSInterval({ baseInterval: 14, predictionError: pe });

Both calls used object-arg signatures that don't match the actual functions. Anyone running the snippet got:

TypeError: Cannot read properties of undefined (reading 'length')

The actual signatures take embedding arrays + positional numbers:

// ✓ correct (now in 0.3.3 README)
const lastEmbedding = [0.1, 0.2, 0.3, 0.4];
const currentEmbedding = [0.5, 0.4, 0.1, 0.2];
const pe = computeKGPredictionError(lastEmbedding, currentEmbedding);
const nextInterval = computeAdaptiveFSRSInterval(14, pe);

Stable surface

  • 0 code changes. Same 22-algorithm dist/ as 0.3.2.
  • 429 tests pass on vitest.
  • tsup ESM/CJS/DTS dual build identical.
  • No new dependencies, no API changes.

🔗 Links