From 804bf40e8b3a646ee92d9b5ca7fca834c3a49a39 Mon Sep 17 00:00:00 2001 From: Loiane Date: Tue, 11 Aug 2026 21:02:03 -0400 Subject: [PATCH] fix js-ts interop constructors --- src/05-queue-deque/palindrome-checker.js | 5 +++-- src/11-heap/heap-sort.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/05-queue-deque/palindrome-checker.js b/src/05-queue-deque/palindrome-checker.js index 36b79808..a687c83f 100644 --- a/src/05-queue-deque/palindrome-checker.js +++ b/src/05-queue-deque/palindrome-checker.js @@ -1,4 +1,5 @@ -const Deque = require('./deque.js'); +const DequeModule = require('./deque.js'); +const Deque = DequeModule.default || DequeModule; function isPalindrome(word) { @@ -26,4 +27,4 @@ function isPalindrome(word) { // Test the palindrome checker console.log(isPalindrome("racecar")); // Output: true -module.exports = isPalindrome; \ No newline at end of file +module.exports = isPalindrome; diff --git a/src/11-heap/heap-sort.js b/src/11-heap/heap-sort.js index e61982bb..f9821393 100644 --- a/src/11-heap/heap-sort.js +++ b/src/11-heap/heap-sort.js @@ -1,6 +1,7 @@ // src/11-heap/heap-sort.js -const Comparator = require('../10-tree/comparator.js'); +const ComparatorModule = require('../10-tree/comparator.js'); +const Comparator = ComparatorModule.default || ComparatorModule; /** * Heapify the array. @@ -54,4 +55,4 @@ const HeapSort = (array, compareFn = Comparator.defaultCompareFn) => { } } -module.exports = HeapSort; \ No newline at end of file +module.exports = HeapSort;