Skip to content

Fix CommonJS/TypeScript constructor interop in deque + heap sort - #269

Merged
loiane merged 1 commit into
mainfrom
loiane/repo-next-steps
Aug 12, 2026
Merged

Fix CommonJS/TypeScript constructor interop in deque + heap sort#269
loiane merged 1 commit into
mainfrom
loiane/repo-next-steps

Conversation

@loiane

@loiane loiane commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • fix Deque import handling in src/05-queue-deque/palindrome-checker.js to support both CommonJS and transpiled default-export module shapes
  • fix Comparator import handling in src/11-heap/heap-sort.js with the same compatibility pattern
  • preserve existing module APIs while eliminating runtime TypeError: ... is not a constructor failures

Why

Some modules are transpiled with exports.default, while these consumers expected direct CommonJS constructor exports. That mismatch caused failing queue/deque and heap-sort test suites.

Validation

  • affected tests now pass:
    • src/05-queue-deque/__test__/algorithms.test.js
    • src/05-queue-deque/__test__/algorithms.test.ts
    • src/11-heap/__test__/heap-sort.test.js
    • src/11-heap/__test__/heap-sort.test.ts
  • TypeScript build succeeds (npm run build:ts)

@loiane
loiane marked this pull request as ready for review August 12, 2026 01:05
@loiane
loiane merged commit cfc4894 into main Aug 12, 2026
1 check passed
@loiane
loiane deleted the loiane/repo-next-steps branch August 12, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant