Skip to content

feat(data-structures/unstable): add RollingCounter serialization#7074

Open
tomas-zijdemans wants to merge 3 commits intodenoland:mainfrom
tomas-zijdemans:rolling-counter-serialize
Open

feat(data-structures/unstable): add RollingCounter serialization#7074
tomas-zijdemans wants to merge 3 commits intodenoland:mainfrom
tomas-zijdemans:rolling-counter-serialize

Conversation

@tomas-zijdemans
Copy link
Copy Markdown
Contributor

@tomas-zijdemans tomas-zijdemans commented Mar 30, 2026

  • Add toJSON() / RollingCounter.from() for JSON-compatible serialization and restoration
  • Add current getter for reading the newest segment without iteration
  • Add Symbol.toStringTag to match module precedent.
  • Optimize rotate() (up to 5.5x faster for bulk rotations) by replacing per-element modulo with contiguous-range processing

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 98.30508% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.41%. Comparing base (1cd63ca) to head (9cded39).

Files with missing lines Patch % Lines
data_structures/unstable_rolling_counter.ts 98.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7074   +/-   ##
=======================================
  Coverage   94.41%   94.41%           
=======================================
  Files         630      630           
  Lines       50490    50543   +53     
  Branches     8949     8963   +14     
=======================================
+ Hits        47669    47721   +52     
  Misses       2249     2249           
- Partials      572      573    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant