1
0
Fork 0
mirror of synced 2024-09-28 23:31:43 +12:00

Merge pull request #8097 from Budibase/bug/sev3/public-api-equals-number

Public api equals query - support for number strings
This commit is contained in:
Michael Drury 2022-10-04 12:48:17 +01:00 committed by GitHub
commit d2c5338446
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -157,8 +157,11 @@ class QueryBuilder {
if (escape && originalType === "string") {
value = `${value}`.replace(/[ #+\-&|!(){}\]^"~*?:\\]/g, "\\$&")
}
// Wrap in quotes
if (hasVersion && wrap) {
if (originalType === "string" && !isNaN(value)) {
value = `"${value}"`
} else if (hasVersion && wrap) {
value = originalType === "number" ? value : `"${value}"`
}
return value