Skip to content

Commit

Permalink
[TS migration] Migrate 'getPlatform' constants dependency to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
blazejkustra committed Aug 23, 2023
1 parent 4f412db commit 066241d
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 066241d

Please sign in to comment.