zrwusa / data-structure-typed

Javascript Data Structure & TypeScript Data Structure. Heap, Binary Tree, Red Black Tree, Linked List, Deque, Trie, HashMap, Directed Graph, Undirected Graph, Binary Search Tree, AVL Tree, Priority Queue, Graph, Queue, Tree Multiset, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue, Stack.
https://data-structure-typed-docs.vercel.app
MIT License
124 stars 9 forks source link

getNodes type checked incorrect #26

Closed zrwusa closed 1 year ago

zrwusa commented 1 year ago

Describe the bug binaryTree.getNodes((node: BinaryTreeNode) => node.val); The statement type checked need to be an error.

To Reproduce Steps to reproduce the behavior: binaryTree.add(5, 'A'); binaryTree.add(3, 'B'); binaryTree.add(7, 'C');

const nodes = binaryTree.getNodes((node: BinaryTreeNode<string>) => node.val);

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

zrwusa commented 1 year ago

In version 1.39.3, we have fixed this.