Skip to content

The open alternative to Salesforce, designed for AI.

379 B
Raw Blame
export const getAppSlug = (
  sourcePackage: string | undefined,
  universalIdentifier: string,
): string => {
  if (sourcePackage === undefined || sourcePackage.length === 0) {
    return universalIdentifier;
  }

  const lastSegment = sourcePackage.split('/').pop();

  return lastSegment !== undefined && lastSegment.length > 0
    ? lastSegment
    : universalIdentifier;
};