-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix bug that return empty “where object” if filter contains utf8letter #9
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @likegun, sorry for the delay. I just started the review, have a look to my comments. Thanks
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "sequelize-querystring", | |||
"version": "0.10.0", | |||
"name": "sequelize-querystring-utf8", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to change the package name?
"name": "sequelize-querystring", | ||
"version": "0.10.0", | ||
"name": "sequelize-querystring-utf8", | ||
"version": "0.10.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to increase the version to 0.11.0
if (expression.match(/(([\w|.]+)\s(\w+)\s([\w|\s|%|_]+),?)+/)) { | ||
let parts = (expression).split(',') | ||
if (expression.match(new RegExp(`(([\\w|.]+)\\s(\\w+)\\s([\\w|\\s|%|_|${utf8letters}]+),?)+`))) { | ||
let parts = (expression).split(/,\s/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why to force a space after a condition separation?
@likegun Did you have any chance to have a look to my feedback? thank you |
In
find
method,if (expression.match(/(([\w|.]+)\s(\w+)\s([\w|\s|%|_]+),?)+/))
,if expression contains utf8letters the
if
condition would be false and return empty where object.