-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The join
is not actually used.
#44
Comments
I agree that the join function isn't used. It looks like that can be deleted just fine. diff --git a/src/tree.ts b/src/tree.ts
index 8d78894..e313c89 100644
--- a/src/tree.ts
+++ b/src/tree.ts
@@ -65,13 +65,10 @@ export function treeify(data: Array<[string, number]>): Node {
* @param join If given, a function that joins the names of the parent and
* child.
*/
-export function flatten(
- n: Node,
- join = (parent: string, child: string) => `${parent}/${child}`
-) {
+export function flatten(n: Node) {
if (n.children) {
for (const c of n.children) {
- flatten(c, join);
+ flatten(c);
}
if (n.children.length === 1) {
const child = n.children[0]; I'm not sure what you're saying about the |
As far as I concered, the purpose of So the new However, the @@ -75,7 +109,7 @@ export function flatten(
}
if (n.children.length === 1) {
const child = n.children[0];
- n.id += '/' + child.id;
+ n.id = join(n.id, child.id);
n.children = child.children;
}
} |
webtreemap/src/tree.ts
Lines 68 to 82 in 5dbfbff
The
join
function is not used though.I think it's possible to modify the line 78. However the
id
property mismatch thejoin
function type.Maybe you can give me a hint.
Thanks.
The text was updated successfully, but these errors were encountered: