Skip to content

Commit 586ce4e

Browse files
♻️ refactor(_debug): Fix docs and use arrow function.
1 parent bfedb15 commit 586ce4e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/debug/debug.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
import {BLACK} from '../color/BLACK.js';
22

33
/**
4-
* Recursively constructs a prettyprint string for the red-black tree rooted at
5-
* <code>root</code>.
4+
* Builds a debug function from color handlers.
65
*
7-
* @param {Node} root - The root of the tree.
8-
* @returns {String}
6+
* @param {Object} colors The colors to use.
7+
* @returns {Function} The debug function.
98
*/
10-
export function _debug({red, black}) {
9+
export const _debug = ({red, black}) => {
10+
/**
11+
* Recursively constructs a prettyprint string for the red-black tree rooted at
12+
* <code>root</code>.
13+
*
14+
* @param {Node} root - The root of the tree.
15+
* @returns {string}
16+
*/
1117
const debug = (root) => {
1218
if (root.isLeaf()) return black('L');
1319

@@ -17,4 +23,4 @@ export function _debug({red, black}) {
1723
};
1824

1925
return debug;
20-
}
26+
};

0 commit comments

Comments
 (0)