Skip to content

Commit

Permalink
Merge pull request #25745 from software-mansion-labs/ts-migration/get…
Browse files Browse the repository at this point in the history
…Platform

[No QA][TS migration] Migrate 'getPlatform' constants dependency to TypeScript
  • Loading branch information
roryabraham authored Aug 24, 2023
2 parents 06b40f6 + 066241d commit 0b62ee5
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 20 deletions.
5 changes: 0 additions & 5 deletions src/libs/getPlatform/index.android.js

This file was deleted.

6 changes: 6 additions & 0 deletions src/libs/getPlatform/index.android.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import CONST from '../../CONST';
import Platform from './types';

export default function getPlatform(): Platform {
return CONST.PLATFORM.ANDROID;
}
5 changes: 0 additions & 5 deletions src/libs/getPlatform/index.desktop.js

This file was deleted.

6 changes: 6 additions & 0 deletions src/libs/getPlatform/index.desktop.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import CONST from '../../CONST';
import Platform from './types';

export default function getPlatform(): Platform {
return CONST.PLATFORM.DESKTOP;
}
5 changes: 0 additions & 5 deletions src/libs/getPlatform/index.ios.js

This file was deleted.

6 changes: 6 additions & 0 deletions src/libs/getPlatform/index.ios.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import CONST from '../../CONST';
import Platform from './types';

export default function getPlatform(): Platform {
return CONST.PLATFORM.IOS;
}
6 changes: 6 additions & 0 deletions src/libs/getPlatform/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import CONST from '../../CONST';
import Platform from './types';

export default function getPlatform(): Platform {
return CONST.PLATFORM.WEB;
}
5 changes: 0 additions & 5 deletions src/libs/getPlatform/index.website.js

This file was deleted.

6 changes: 6 additions & 0 deletions src/libs/getPlatform/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {ValueOf} from 'type-fest';
import CONST from '../../CONST';

type Platform = ValueOf<typeof CONST.PLATFORM>;

export default Platform;

0 comments on commit 0b62ee5

Please sign in to comment.