Skip to content

feat(data-structures/unstable): add includes() and removeAt() to Deque#7083

Open
tomas-zijdemans wants to merge 2 commits intodenoland:mainfrom
tomas-zijdemans:deque-ready
Open

feat(data-structures/unstable): add includes() and removeAt() to Deque#7083
tomas-zijdemans wants to merge 2 commits intodenoland:mainfrom
tomas-zijdemans:deque-ready

Conversation

@tomas-zijdemans
Copy link
Copy Markdown
Contributor

  • Add includes() method (matching Array.prototype.includes), and removeAt(index) for removing elements by index with negative-index support.
  • Add a time-complexity table to the Deque class JSDoc to match BinaryHeap docs.
  • Optimize hot paths: replace generator-based [Symbol.iterator]() and reversed() with manual iterator objects, use slice/concat in toArray() and #copyBuffer instead of per-element loops, and add a fast path in Deque.from() for plain arrays without a map function
  • Extract #maybeGrow() and #removeAtUnchecked() private helpers to reduce duplication

@tomas-zijdemans tomas-zijdemans changed the title feat(data-structures/unstable): add includes() and removeAt() to Deque feat(data-structures/unstable): add includes() and removeAt() to Deque Apr 3, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 95.83333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.41%. Comparing base (1cd63ca) to head (bac0575).

Files with missing lines Patch % Lines
data_structures/unstable_deque.ts 95.83% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7083      +/-   ##
==========================================
- Coverage   94.41%   94.41%   -0.01%     
==========================================
  Files         630      630              
  Lines       50490    50551      +61     
  Branches     8949     8959      +10     
==========================================
+ Hits        47669    47726      +57     
- Misses       2249     2252       +3     
- 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