Closed finn-vgtl closed 2 years ago
When will this patch be released to the npm repository?
It will be released when the next major is ready, that is pending finalization in https://github.com/redotjs/redot/pull/25 Pull requests to help move the next major forward are welcome. Otherwise be patient.
First of all, I'd like to say thank you for this amazing library! Its scope is simply perfect for my use-case.
While implementing
redot
in my project I've used the following dot notation for testing purposes. (Notice how I used integers for my node id's)Converting this digraph to an AST using
redot.parse()
worked absolutely perfectly, however, usingredot.stringify()
to convert the newly generated AST back to a DOT-notation threw an error:After a bit of debugging, I found out that using strings as node id's won't trigger the error so I've implemented an extra step in the
.utilQuotesAndEscaping()
function to ensure compatibility with integers in my local setup. Obviously, this is a temporary solution so I'm proposing these changes directly to you:TL:DR
This PR proposes a small change to convert the
text
parameter of the function.utilQuotesAndEscaping()
to string before trying to call.indexOf()
on it, ensuring the latter function is available in the prototype, thus preventing errors.Thanks for considering my PR! 🙋♂️