Skip to content

Commit

Permalink
refactor: improved type safety of platformConfig in createRun function (
Browse files Browse the repository at this point in the history
#2286)

* refactor: improved type safety of platformConfig in createRun

* refactor:  improved type safety of platformConfig in createBuild

* refactor: remove undefined type casting from platformConfig
  • Loading branch information
hoonjoo-park committed Feb 19, 2024
1 parent d294170 commit 9efcef7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const createBuild =
({platformName}: BuilderCommand) =>
async (_: Array<string>, ctx: Config, args: BuildFlags) => {
const platformConfig = ctx.project[platformName] as IOSProjectConfig;

if (
platformConfig === undefined ||
supportedPlatforms[platformName] === undefined
Expand All @@ -21,9 +22,9 @@ const createBuild =
}

let installedPods = false;
if (platformConfig?.automaticPodsInstallation || args.forcePods) {
const isAppRunningNewArchitecture = platformConfig?.sourceDir
? await getArchitecture(platformConfig?.sourceDir)
if (platformConfig.automaticPodsInstallation || args.forcePods) {
const isAppRunningNewArchitecture = platformConfig.sourceDir
? await getArchitecture(platformConfig.sourceDir)
: undefined;

await resolvePods(ctx.root, ctx.dependencies, platformName, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ const createRun =
let {packager, port} = args;
let installedPods = false;
// check if pods need to be installed
if (platformConfig?.automaticPodsInstallation || args.forcePods) {
const isAppRunningNewArchitecture = platformConfig?.sourceDir
? await getArchitecture(platformConfig?.sourceDir)
if (platformConfig.automaticPodsInstallation || args.forcePods) {
const isAppRunningNewArchitecture = platformConfig.sourceDir
? await getArchitecture(platformConfig.sourceDir)
: undefined;

await resolvePods(ctx.root, ctx.dependencies, platformName, {
Expand Down

0 comments on commit 9efcef7

Please sign in to comment.