-
Notifications
You must be signed in to change notification settings - Fork 623
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
feat: use consistent quotes that don't need to be escaped #9234
Conversation
@@ -209,23 +209,26 @@ export function fieldFilterExpression(predicate: FieldPredicate, useInRange = tr | |||
: rawFieldExpr; | |||
|
|||
if (isFieldEqualPredicate(predicate)) { | |||
return `${fieldExpr}===${predicateValueExpr(predicate.equal, unit)}`; | |||
const equal = predicate.equal; | |||
return `${fieldExpr} === ${predicateValueExpr(equal, unit)}`; |
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.
Let's change spacing in a separate pull request.
} else if (isFieldValidPredicate(predicate)) { | ||
return fieldValidPredicate(fieldExpr, predicate.valid); | ||
const valid = predicate.valid; | ||
return fieldValidPredicate(fieldExpr, valid); |
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.
Not really a need to define a variable for one use.
} | ||
|
||
function escapePathAccess(string: string) { | ||
return string.replace(/(\[|\]|\.|'|")/g, '\\$1'); | ||
} | ||
|
||
function doubleQuotes2Single(string: string) { |
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.
No, we can't do this. It's too brittle and possibly introduces errors. If we want to change the quotes, we need to extend stringValue
to accept a quote parameter.
Are you still working on this? |
fixes #4112