sdk-for-node
sdk-for-node copied to clipboard
Update query.js
trafficstars
static equal = (attribute, value) => ^
SyntaxError: Unexpected token =
static equal = (attribute, value) => ^
SyntaxError: Unexpected token =
Incorrectly set static property.
@CodesbyRobot Can you please mention the nodejs version you are using that's giving the issue?
Node 10.19.0
Hey there 👋
- I can confirm our current syntax does not work in Node 10.x. I can also confirm your syntax will work on 0.10, AND new newer versions
- You marked all methods
async, which is not required. Query is a utility class that takes input, and generated string. Everything is sync, we don't need to await them. - Make sure to add
returnstatements into the methods, because with this new syntax, areturnkeyword is required. Example:
static equal(attribute, value) {
return Query.addQuery(attribute, "equal", value);
}
- Our SDK libraries are read-only, as they are automatically generated from our SDK generator. This helps us automate 90% of maintenance, and keep the remaining 10% in one place. Could you please look at this repository and try to apply these changes there? The same changes might be valuable for Deno and Web SDKs.
Happy to help if you have any questions or concerns 😇
Closing because of Matej's comments and this is stale now.