Update parameter names and add Node.js type definitions

Renamed `url` to `path` in `trackPageView` method to reflect its actual use. Added `@types/node` package to the dependencies for improved type safety and development experience.
This commit is contained in:
gbuomprisco
2024-08-07 12:38:42 +02:00
parent 573f3495e6
commit e3503d8d47
4 changed files with 9 additions and 13 deletions

View File

@@ -16,7 +16,8 @@
"@kit/eslint-config": "workspace:*",
"@kit/prettier-config": "workspace:*",
"@kit/tailwind-config": "workspace:*",
"@kit/tsconfig": "workspace:*"
"@kit/tsconfig": "workspace:*",
"@types/node": "^22.1.0"
},
"eslintConfig": {
"root": true,

View File

@@ -77,9 +77,9 @@ export function createAnalyticsManager<T extends string, Config extends object>(
);
},
trackPageView: (url: string) => {
trackPageView: (path: string) => {
return Promise.all(
getActiveServices().map((service) => service.trackPageView(url)),
getActiveServices().map((service) => service.trackPageView(path)),
);
},

View File

@@ -6,7 +6,7 @@ interface TrackEvent {
}
interface TrackPageView {
trackPageView(url: string): Promise<unknown>;
trackPageView(path: string): Promise<unknown>;
}
interface Identify {