open-scd
open-scd copied to clipboard
Fix compareNames
https://github.com/openscd/open-scd/blob/81b9486c3a54997e59b119af2a0773ea29e47cec/src/foundation.ts#L2445 has an inaccurate doc comment.
Also, the function fails if one of the comparands is an element without the name
attribute (as described here ).
I will have a look at it tomorrow. Just out of curiosity. What triggered it? Do we see some wrong behavior?
We see an error if we try to compare elements that don't have the name
attribute set.
Regarding the slightly misleading doc comment: The function actually compares elements (like its name suggests), it doesn't sort them (like the doc comment suggests).