-
Notifications
You must be signed in to change notification settings - Fork 7
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
Javascript Split function seems not work well #30
Comments
Thanks for the report and use case! I changed the regexp: 2ca7e32 Does this work for you? Do you see some other problems happening because of this approach? |
Thanks a lot for your quick fix. It works well for my case. const named = require('yesql').pg;
const sql = "select 'C:\\work' as \"path_with_\\_in_it\"";
const after=named(sql)({})
console.log(`after.text=${after.text}`); I hope that output should be: but: Thanks. |
Good catch, thank you! Fixed the same way in release 6.1.0 Does this work for you? Do you see some other problems happening because of this approach? |
Now all is Ok! Thank you! |
Hi, Mr. Mattila,
Thank you for your module, it's very useful to me.
I found a case that does not match my wants.
This code reproduces the situation.
I hoped this should be {"text": "select 'C:\work' as path","values":[]}.
But the result is:
after={"text":"select 'C:\work'\work as path","values":[]}
I guess this "work work" is caused by the spec of
Split
function of Javascript.So I added split_reg function to String prototype, and now it works well.
How do you think about this workaround? Or is there any better way to go?
Thanks.
The text was updated successfully, but these errors were encountered: