@mikezimm/fps-core-v7
Version:
Library of reusable core interfaces, types and constants migrated from fps-library-v2
11 lines • 547 B
JavaScript
export function getPageTitle(item) {
// 2024-09-07: Set 'return undefined as any' to remove typing warning
if (!item) {
console.log(`EasyAnalytics ERROR: getPageTitle item is undefined!`, item);
return undefined;
}
const { PageLink, PageURL } = item;
let result = PageLink && PageLink.Description.indexOf('.aspx') > 0 ? PageLink.Description : PageURL && PageURL.indexOf('.aspx') > 0 ? PageURL.substring(PageURL.lastIndexOf('/') + 1) : '';
return result;
}
//# sourceMappingURL=getPageTitle.js.map