Not sure what the intention is here:
|
const routeNode = new RouteNode( |
|
route.name, |
|
route.path, |
|
route.children, |
|
cb, |
|
this, |
|
false, |
|
sort |
|
) |
|
const fullName = routeNode |
|
.getParentSegments([routeNode]) |
|
.map(_ => _.name) |
|
.join('.') |
|
if (cb) { |
|
cb({ |
|
...route, |
|
name: fullName |
|
}) |
|
} |
|
this.addRouteNode(routeNode, sort) |
But in the cb, the name field is overwritten by this fullName property.
This is the only time in the entire lifecycle of the RouteNode where the name is obscured and overwritten as such.
Is this intentional? It's breaking code in router5 (and probably other places?) that rely on the callback.
It seems extra bad that the node itself doesn't get this fullName property -- just the spread in this callback.
Not sure what the intention is here:
route-node/modules/RouteNode.ts
Lines 142 to 161 in 71fd8d9
But in the
cb, thenamefield is overwritten by thisfullNameproperty.This is the only time in the entire lifecycle of the
RouteNodewhere the name is obscured and overwritten as such.Is this intentional? It's breaking code in
router5(and probably other places?) that rely on the callback.It seems extra bad that the node itself doesn't get this
fullNameproperty -- just the spread in this callback.