Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

likegun
Copy link

@likegun likegun commented Apr 16, 2019

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.

@likegun likegun changed the title fix bug that return empty where if filter contains utf8letter fix bug that return empty “where object” if filter contains utf8letter Apr 16, 2019
Copy link
Contributor

@ricmalta ricmalta left a 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",
Copy link
Contributor

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",
Copy link
Contributor

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/)
Copy link
Contributor

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?

@ricmalta
Copy link
Contributor

@likegun Did you have any chance to have a look to my feedback? thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants