We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5cf10dd commit e099a69Copy full SHA for e099a69
src/printBinary.ts
@@ -1,9 +1,9 @@
1
type Child = (tab: string) => string;
2
3
export const printBinary = (tab = '', children: [left?: null | Child, right?: null | Child]): string => {
4
- const [left, right] = children;
+ const left = children[0], right = children[1];
5
let str = '';
6
- if (left) str += `\n${tab}← ${left(tab + ' ')}`;
7
- if (right) str += `\n${tab}→ ${right(tab + ' ')}`;
+ if (left) str += '\n' + tab + '← ' + left(tab + ' ');
+ if (right) str += '\n' + tab + '→ ' + right(tab + ' ');
8
return str;
9
};
0 commit comments