18 lines
559 B
TypeScript

export const getFullUrl = (url?: string) => {
const BASE_URL = 'https://sg-delivery-api.convexsol.co';
if (!url) return '';
return url.startsWith('/') ? `${BASE_URL}${url}` : url;
};
export const isPdf = (fileNameOrUrl?: string) => {
if (!fileNameOrUrl) return false;
const clean = fileNameOrUrl.toLowerCase().split('?')[0];
return clean.endsWith('.pdf');
};
export const maskAccountNumber = (num: string): string => {
if (!num || num.length <= 4) return num;
const masked = '•'.repeat(num.length - 4);
return masked + num.slice(-4);
};