Skip to content

Commit 61a8260

Browse files
committed
fix: ts lint
1 parent 72bacca commit 61a8260

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

crates/js/lib/src/integrations/google_tag_manager/script_guard.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ function extractGtmPath(url: string): string {
5151
} catch {
5252
// Fallback: extract path after the domain
5353
console.debug('[GTM Guard] URL parsing failed, using fallback for:', url);
54-
const match = url.match(
55-
/www\.(?:googletagmanager|google-analytics)\.com(\/[^'"\s]*)/i,
56-
);
54+
const match = url.match(/www\.(?:googletagmanager|google-analytics)\.com(\/[^'"\s]*)/i);
5755
return match?.[1] || '/gtm.js';
5856
}
5957
}

crates/js/lib/test/integrations/google_tag_manager/script_guard.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ describe('GTM Script Interception Guard', () => {
8080
expect(extractGtmPath('https://www.googletagmanager.com/gtm.js?id=GTM-XXXX')).toBe(
8181
'/gtm.js?id=GTM-XXXX'
8282
);
83-
expect(
84-
extractGtmPath('https://www.google-analytics.com/g/collect?v=2&tid=G-TEST')
85-
).toBe('/g/collect?v=2&tid=G-TEST');
83+
expect(extractGtmPath('https://www.google-analytics.com/g/collect?v=2&tid=G-TEST')).toBe(
84+
'/g/collect?v=2&tid=G-TEST'
85+
);
8686
});
8787

8888
it('should handle bare domain', () => {
@@ -107,7 +107,9 @@ describe('GTM Script Interception Guard', () => {
107107
const rewritten = rewriteGtmUrl(
108108
'https://www.googletagmanager.com/gtm.js?id=GTM-XXXX&l=dataLayer'
109109
);
110-
expect(rewritten).toContain('/integrations/google_tag_manager/gtm.js?id=GTM-XXXX&l=dataLayer');
110+
expect(rewritten).toContain(
111+
'/integrations/google_tag_manager/gtm.js?id=GTM-XXXX&l=dataLayer'
112+
);
111113
});
112114
});
113115

0 commit comments

Comments
 (0)