From b71d841013cdc9a3029fd3fc82c5638b7763c320 Mon Sep 17 00:00:00 2001 From: Akash Gupta Date: Wed, 17 Jul 2024 16:01:13 +0530 Subject: [PATCH] feat(tracking-plan): refactor --- src/cli/api/trackingplans.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/cli/api/trackingplans.ts b/src/cli/api/trackingplans.ts index e5079ac9..0aef4458 100644 --- a/src/cli/api/trackingplans.ts +++ b/src/cli/api/trackingplans.ts @@ -144,11 +144,8 @@ export function toTrackingPlanId(trackingPlan: RudderAPI.TrackingPlan): string { return trackingPlan.id; } -export function getTrackingPlanName(trackingPlan: RudderAPI.TrackingPlan): string { - // throw new Error(`Unable to parse Tracking Plan name: ${JSON.stringify(trackingPlan)}`); - if (!trackingPlan.creationType) { - return trackingPlan.display_name; - } - - return trackingPlan.name; +export function getTrackingPlanName( + trackingPlan: Pick, +): string { + return !trackingPlan.creationType ? trackingPlan.display_name : trackingPlan.name; }