Skip to content

Commit

Permalink
Merge "[email protected]: support trailing semicolon in GaarfSQL" into main
Browse files Browse the repository at this point in the history
  • Loading branch information
evil-shrike authored and Gerrit Code Review committed Feb 28, 2024
2 parents b9b0932 + a1bb21b commit 99120e8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion js/dist/lib/ads-query-editor.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/lib/ads-query-editor.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "google-ads-api-report-fetcher",
"version": "2.8.0",
"version": "2.8.1",
"description": "Google Ads API Report Fetcher (gaarf)",
"main": "./dist/index.js",
"types": "./src/index.ts",
Expand Down
4 changes: 3 additions & 1 deletion js/src/lib/ads-query-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export class AdsQueryEditor {
query = query.replaceAll(/\/\*([\s\S]*?)\*\//g, "");
// remove non-single whitespaces
query = "" + query.replace(/\s{2,}/g, " ");
return query.trim();
// remove trailing semicolon
query = query.trim().replace(/;$/gm, '')
return query;
}

private parseFunctions(query: string): Record<string, Function> {
Expand Down

0 comments on commit 99120e8

Please sign in to comment.