Skip to content

Commit

Permalink
[email protected]: support trailing semicolon in GaarfSQL
Browse files Browse the repository at this point in the history
Change-Id: Ic398bb8df5d570698c5b4f8e4712a7eb29d33eab
  • Loading branch information
evil-shrike committed Feb 28, 2024
1 parent a329fe3 commit a1bb21b
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 a1bb21b

Please sign in to comment.