Skip to content

Commit 74d92ff

Browse files
committed
cleanup mapper
1 parent af619f1 commit 74d92ff

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

packages/mapper/src/adapters/umami.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ const sessionIdMap = new Map<string, string>();
4444
const anonIdMap = new Map<string, string>();
4545

4646
function getOrCreateSessionId(original: string): string {
47-
if (!original) return '';
47+
if (!original) {
48+
return '';
49+
}
4850
if (!sessionIdMap.has(original)) {
4951
sessionIdMap.set(original, `sess_${crypto.randomUUID()}`);
5052
}

packages/mapper/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { umamiAdapter } from './adapters';
2-
import type { AnalyticsEventAdapter } from './types';
32

43
export { mapEvents } from './utils-map-events';
54

65
export const adapters = { umami: umamiAdapter };
7-
export type { AnalyticsEventAdapter };
6+
export type { AnalyticsEventAdapter } from './types';

packages/mapper/src/types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import type { AnalyticsEvent } from '@databuddy/db';
2-
32
export interface AnalyticsEventAdapter<T> {
43
mapRowToEvent(row: T): AnalyticsEvent;
54
}
6-
7-
export type { AnalyticsEvent };

packages/mapper/src/utils-map-events.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import type { AnalyticsEvent, AnalyticsEventAdapter } from './types';
1+
import type { AnalyticsEvent } from '@databuddy/db';
2+
import type { AnalyticsEventAdapter } from './types';
23

34
/**
45
* Maps an array of input rows to AnalyticsEvent using the provided adapter.

0 commit comments

Comments
 (0)