Skip to content

Commit

Permalink
remove enum
Browse files Browse the repository at this point in the history
  • Loading branch information
alaamegahed committed Jan 9, 2025
1 parent 2756307 commit 09877b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/clarity-decode/src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function envelope(tokens: Data.Token[]): Data.Envelope {
pageNum: tokens[7] as number,
upload: tokens[8] as Data.Upload,
end: tokens[9] as Data.BooleanFlag,
applicationPlatform: tokens[10] as Data.ApplicationPlatform,
applicationPlatform: tokens[10] as number,
url: tokens[11] as string
};
}
6 changes: 3 additions & 3 deletions packages/clarity-js/src/data/envelope.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BooleanFlag, Token, Upload, Envelope, ApplicationPlatform } from "@clarity-types/data";
import { BooleanFlag, Token, Upload, Envelope } from "@clarity-types/data";
import { time } from "@src/core/time";
import version from "@src/core/version";
import * as metadata from "@src/data/metadata";
Expand All @@ -19,7 +19,7 @@ export function start(): void {
pageNum: m.pageNum,
upload: Upload.Async,
end: BooleanFlag.False,
applicationPlatform: ApplicationPlatform.WebApp,
applicationPlatform: 0,
url: ''
};
}
Expand All @@ -34,7 +34,7 @@ export function envelope(last: boolean): Token[] {
data.sequence++;
data.upload = last && "sendBeacon" in navigator ? Upload.Beacon : Upload.Async;
data.end = last ? BooleanFlag.True : BooleanFlag.False;
data.applicationPlatform = ApplicationPlatform.WebApp;
data.applicationPlatform = 0;
data.url = scrub.url(location.href, false, true);
return [
data.version,
Expand Down
8 changes: 1 addition & 7 deletions packages/clarity-js/types/data.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,6 @@ export const enum Upload {
Beacon = 1
}

export const enum ApplicationPlatform {
WebApp = 0,
AndroidApp = 1,
IOSApp = 2
}

export const enum BooleanFlag {
False = 0,
True = 1
Expand Down Expand Up @@ -397,7 +391,7 @@ export interface Envelope extends Metadata {
version: string;
upload: Upload;
end: BooleanFlag;
applicationPlatform: ApplicationPlatform;
applicationPlatform: number;
url: string;
}

Expand Down

0 comments on commit 09877b6

Please sign in to comment.