Skip to content

Commit

Permalink
small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomura committed Feb 21, 2025
1 parent 01d48f6 commit e9438d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/analytics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ function setProcessPlatform(platform: NodeJS.Platform) {
describe('viewScreenEvent', () => {
const originalPlatform = process.platform;

beforeAll(() => {
setProcessPlatform('win32');
});

beforeEach(() => {
setProcessPlatform('win32');
mockedData.getFirstAAID_value = true;
});

Expand Down
6 changes: 4 additions & 2 deletions src/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const Registry = {
};

class AnalyticsPlatform {
private static nodeJsPlatformMapping: Record<string, any> = {
private static nodeJsPlatformMapping: Record<NodeJS.Platform, string> = {
aix: 'desktop',
android: 'android',
darwin: 'mac',
Expand All @@ -31,9 +31,11 @@ class AnalyticsPlatform {
sunos: 'desktop',
win32: 'windows',
cygwin: 'windows',
haiku: 'unknown',
netbsd: 'unknown',
};

static for(p: string): string {
static for(p: NodeJS.Platform): string {
return this.nodeJsPlatformMapping[p] || 'unknown';
}
}
Expand Down

0 comments on commit e9438d4

Please sign in to comment.